@hpcc-js/dgrid2 2.5.3 → 2.5.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../src/__package__.ts","../../../node_modules/tslib/tslib.es6.mjs","../../../node_modules/preact/src/constants.js","../../../node_modules/preact/src/util.js","../../../node_modules/preact/src/options.js","../../../node_modules/preact/src/create-element.js","../../../node_modules/preact/src/component.js","../../../node_modules/preact/src/diff/props.js","../../../node_modules/preact/src/create-context.js","../../../node_modules/preact/src/diff/children.js","../../../node_modules/preact/src/diff/index.js","../../../node_modules/preact/src/render.js","../../../node_modules/preact/src/diff/catch-error.js","../../../node_modules/preact/hooks/src/index.js","../../../node_modules/preact/compat/src/util.js","../../../node_modules/preact/compat/src/hooks.js","../../../node_modules/preact/compat/src/PureComponent.js","../../../node_modules/preact/compat/src/memo.js","../../../node_modules/preact/compat/src/forwardRef.js","../../../node_modules/preact/compat/src/Children.js","../../../node_modules/preact/compat/src/suspense.js","../../../node_modules/preact/compat/src/suspense-list.js","../../../node_modules/preact/compat/src/portals.js","../../../node_modules/preact/compat/src/render.js","../../../node_modules/preact/compat/src/index.js","../../../node_modules/clsx/dist/clsx.m.js","../../../node_modules/preact/jsx-runtime/src/index.js","../../../node_modules/react-data-grid/node_modules/style-inject/dist/style-inject.es.js","../../../node_modules/react-data-grid/src/style/cell.ts","../../../node_modules/react-data-grid/src/style/core.ts","../../../node_modules/react-data-grid/src/style/grouprow.ts","../../../node_modules/react-data-grid/src/style/header.ts","../../../node_modules/react-data-grid/src/style/row.ts","../../../node_modules/react-data-grid/src/hooks/useFocusRef.ts","../../../node_modules/react-data-grid/src/formatters/SelectCellFormatter.tsx","../../../node_modules/react-data-grid/src/formatters/ValueFormatter.tsx","../../../node_modules/react-data-grid/src/formatters/ToggleGroupFormatter.tsx","../../../node_modules/react-data-grid/src/utils/colSpanUtils.ts","../../../node_modules/react-data-grid/src/utils/domUtils.ts","../../../node_modules/react-data-grid/src/utils/keyboardUtils.ts","../../../node_modules/react-data-grid/src/utils/selectedCellUtils.ts","../../../node_modules/react-data-grid/src/utils/index.ts","../../../node_modules/react-data-grid/src/Columns.tsx","../../../node_modules/react-data-grid/src/hooks/useCalculatedColumns.ts","../../../node_modules/react-data-grid/src/hooks/useGridDimensions.ts","../../../node_modules/react-data-grid/src/hooks/useLatestFunc.ts","../../../node_modules/react-data-grid/src/hooks/useRowSelection.ts","../../../node_modules/react-data-grid/src/hooks/useViewportColumns.ts","../../../node_modules/react-data-grid/src/hooks/useViewportRows.ts","../../../node_modules/react-data-grid/src/headerCells/SortableHeaderCell.tsx","../../../node_modules/react-data-grid/src/HeaderCell.tsx","../../../node_modules/react-data-grid/src/HeaderRow.tsx","../../../node_modules/react-data-grid/src/Cell.tsx","../../../node_modules/react-data-grid/src/EditCell.tsx","../../../node_modules/react-data-grid/src/Row.tsx","../../../node_modules/react-data-grid/src/GroupCell.tsx","../../../node_modules/react-data-grid/src/GroupRow.tsx","../../../node_modules/react-data-grid/src/SummaryCell.tsx","../../../node_modules/react-data-grid/src/SummaryRow.tsx","../../../node_modules/react-data-grid/src/DataGrid.tsx","../src/hooks.ts","../src/reactTable.tsx","../../../node_modules/style-inject/dist/style-inject.es.js","../src/table.ts"],"sourcesContent":["export const PKG_NAME = \"@hpcc-js/dgrid2\";\r\nexport const PKG_VERSION = \"2.5.2\";\r\nexport const BUILD_VERSION = \"2.108.6\";\r\n","/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n }\n return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nvar ownKeys = function(o) {\n ownKeys = Object.getOwnPropertyNames || function (o) {\n var ar = [];\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\n return ar;\n };\n return ownKeys(o);\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport function __addDisposableResource(env, value, async) {\n if (value !== null && value !== void 0) {\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\n var dispose, inner;\n if (async) {\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\n dispose = value[Symbol.asyncDispose];\n }\n if (dispose === void 0) {\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\n dispose = value[Symbol.dispose];\n if (async) inner = dispose;\n }\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\n env.stack.push({ value: value, dispose: dispose, async: async });\n }\n else if (async) {\n env.stack.push({ async: true });\n }\n return value;\n}\n\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n var e = new Error(message);\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n};\n\nexport function __disposeResources(env) {\n function fail(e) {\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\n env.hasError = true;\n }\n var r, s = 0;\n function next() {\n while (r = env.stack.pop()) {\n try {\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\n if (r.dispose) {\n var result = r.dispose.call(r.value);\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n }\n else s |= 1;\n }\n catch (e) {\n fail(e);\n }\n }\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\n if (env.hasError) throw env.error;\n }\n return next();\n}\n\nexport function __rewriteRelativeImportExtension(path, preserveJsx) {\n if (typeof path === \"string\" && /^\\.\\.?\\//.test(path)) {\n return path.replace(/\\.(tsx)$|((?:\\.d)?)((?:\\.[^./]+?)?)\\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {\n return tsx ? preserveJsx ? \".jsx\" : \".js\" : d && (!ext || !cm) ? m : (d + ext + \".\" + cm.toLowerCase() + \"js\");\n });\n }\n return path;\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __esDecorate,\n __runInitializers,\n __propKey,\n __setFunctionName,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n __addDisposableResource,\n __disposeResources,\n __rewriteRelativeImportExtension,\n};\n","/** Normal hydration that attaches to a DOM tree but does not diff it. */\nexport const MODE_HYDRATE = 1 << 5;\n/** Signifies this VNode suspended on the previous render */\nexport const MODE_SUSPENDED = 1 << 7;\n/** Indicates that this node needs to be inserted while patching children */\nexport const INSERT_VNODE = 1 << 2;\n/** Indicates a VNode has been matched with another VNode in the diff */\nexport const MATCHED = 1 << 1;\n\n/** Reset all mode flags */\nexport const RESET_MODE = ~(MODE_HYDRATE | MODE_SUSPENDED);\n\nexport const SVG_NAMESPACE = 'http://www.w3.org/2000/svg';\nexport const XHTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';\nexport const MATH_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';\n\nexport const NULL = null;\nexport const UNDEFINED = undefined;\nexport const EMPTY_OBJ = /** @type {any} */ ({});\nexport const EMPTY_ARR = [];\nexport const IS_NON_DIMENSIONAL =\n\t/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;\n","import { EMPTY_ARR } from './constants';\n\nexport const isArray = Array.isArray;\n\n/**\n * Assign properties from `props` to `obj`\n * @template O, P The obj and props types\n * @param {O} obj The object to copy properties to\n * @param {P} props The object to copy properties from\n * @returns {O & P}\n */\nexport function assign(obj, props) {\n\t// @ts-expect-error We change the type of `obj` to be `O & P`\n\tfor (let i in props) obj[i] = props[i];\n\treturn /** @type {O & P} */ (obj);\n}\n\n/**\n * Remove a child node from its parent if attached. This is a workaround for\n * IE11 which doesn't support `Element.prototype.remove()`. Using this function\n * is smaller than including a dedicated polyfill.\n * @param {import('./index').ContainerNode} node The node to remove\n */\nexport function removeNode(node) {\n\tif (node && node.parentNode) node.parentNode.removeChild(node);\n}\n\nexport const slice = EMPTY_ARR.slice;\n","import { _catchError } from './diff/catch-error';\n\n/**\n * The `option` object can potentially contain callback functions\n * that are called during various stages of our renderer. This is the\n * foundation on which all our addons like `preact/debug`, `preact/compat`,\n * and `preact/hooks` are based on. See the `Options` type in `internal.d.ts`\n * for a full list of available option hooks (most editors/IDEs allow you to\n * ctrl+click or cmd+click on mac the type definition below).\n * @type {import('./internal').Options}\n */\nconst options = {\n\t_catchError\n};\n\nexport default options;\n","import { slice } from './util';\nimport options from './options';\nimport { NULL, UNDEFINED } from './constants';\n\nlet vnodeId = 0;\n\n/**\n * Create an virtual node (used for JSX)\n * @param {import('./internal').VNode[\"type\"]} type The node name or Component constructor for this\n * virtual node\n * @param {object | null | undefined} [props] The properties of the virtual node\n * @param {Array<import('.').ComponentChildren>} [children] The children of the\n * virtual node\n * @returns {import('./internal').VNode}\n */\nexport function createElement(type, props, children) {\n\tlet normalizedProps = {},\n\t\tkey,\n\t\tref,\n\t\ti;\n\tfor (i in props) {\n\t\tif (i == 'key') key = props[i];\n\t\telse if (i == 'ref') ref = props[i];\n\t\telse normalizedProps[i] = props[i];\n\t}\n\n\tif (arguments.length > 2) {\n\t\tnormalizedProps.children =\n\t\t\targuments.length > 3 ? slice.call(arguments, 2) : children;\n\t}\n\n\t// If a Component VNode, check for and apply defaultProps\n\t// Note: type may be undefined in development, must never error here.\n\tif (typeof type == 'function' && type.defaultProps != NULL) {\n\t\tfor (i in type.defaultProps) {\n\t\t\tif (normalizedProps[i] === UNDEFINED) {\n\t\t\t\tnormalizedProps[i] = type.defaultProps[i];\n\t\t\t}\n\t\t}\n\t}\n\n\treturn createVNode(type, normalizedProps, key, ref, NULL);\n}\n\n/**\n * Create a VNode (used internally by Preact)\n * @param {import('./internal').VNode[\"type\"]} type The node name or Component\n * Constructor for this virtual node\n * @param {object | string | number | null} props The properties of this virtual node.\n * If this virtual node represents a text node, this is the text of the node (string or number).\n * @param {string | number | null} key The key for this virtual node, used when\n * diffing it against its children\n * @param {import('./internal').VNode[\"ref\"]} ref The ref property that will\n * receive a reference to its created child\n * @returns {import('./internal').VNode}\n */\nexport function createVNode(type, props, key, ref, original) {\n\t// V8 seems to be better at detecting type shapes if the object is allocated from the same call site\n\t// Do not inline into createElement and coerceToVNode!\n\t/** @type {import('./internal').VNode} */\n\tconst vnode = {\n\t\ttype,\n\t\tprops,\n\t\tkey,\n\t\tref,\n\t\t_children: NULL,\n\t\t_parent: NULL,\n\t\t_depth: 0,\n\t\t_dom: NULL,\n\t\t_component: NULL,\n\t\tconstructor: UNDEFINED,\n\t\t_original: original == NULL ? ++vnodeId : original,\n\t\t_index: -1,\n\t\t_flags: 0\n\t};\n\n\t// Only invoke the vnode hook if this was *not* a direct copy:\n\tif (original == NULL && options.vnode != NULL) options.vnode(vnode);\n\n\treturn vnode;\n}\n\nexport function createRef() {\n\treturn { current: NULL };\n}\n\nexport function Fragment(props) {\n\treturn props.children;\n}\n\n/**\n * Check if a the argument is a valid Preact VNode.\n * @param {*} vnode\n * @returns {vnode is VNode}\n */\nexport const isValidElement = vnode =>\n\tvnode != NULL && vnode.constructor === UNDEFINED;\n","import { assign } from './util';\nimport { diff, commitRoot } from './diff/index';\nimport options from './options';\nimport { Fragment } from './create-element';\nimport { MODE_HYDRATE, NULL } from './constants';\n\n/**\n * Base Component class. Provides `setState()` and `forceUpdate()`, which\n * trigger rendering\n * @param {object} props The initial component props\n * @param {object} context The initial context from parent components'\n * getChildContext\n */\nexport function BaseComponent(props, context) {\n\tthis.props = props;\n\tthis.context = context;\n}\n\n/**\n * Update component state and schedule a re-render.\n * @this {import('./internal').Component}\n * @param {object | ((s: object, p: object) => object)} update A hash of state\n * properties to update with new values or a function that given the current\n * state and props returns a new partial state\n * @param {() => void} [callback] A function to be called once component state is\n * updated\n */\nBaseComponent.prototype.setState = function (update, callback) {\n\t// only clone state when copying to nextState the first time.\n\tlet s;\n\tif (this._nextState != NULL && this._nextState != this.state) {\n\t\ts = this._nextState;\n\t} else {\n\t\ts = this._nextState = assign({}, this.state);\n\t}\n\n\tif (typeof update == 'function') {\n\t\t// Some libraries like `immer` mark the current state as readonly,\n\t\t// preventing us from mutating it, so we need to clone it. See #2716\n\t\tupdate = update(assign({}, s), this.props);\n\t}\n\n\tif (update) {\n\t\tassign(s, update);\n\t}\n\n\t// Skip update if updater function returned null\n\tif (update == NULL) return;\n\n\tif (this._vnode) {\n\t\tif (callback) {\n\t\t\tthis._stateCallbacks.push(callback);\n\t\t}\n\t\tenqueueRender(this);\n\t}\n};\n\n/**\n * Immediately perform a synchronous re-render of the component\n * @this {import('./internal').Component}\n * @param {() => void} [callback] A function to be called after component is\n * re-rendered\n */\nBaseComponent.prototype.forceUpdate = function (callback) {\n\tif (this._vnode) {\n\t\t// Set render mode so that we can differentiate where the render request\n\t\t// is coming from. We need this because forceUpdate should never call\n\t\t// shouldComponentUpdate\n\t\tthis._force = true;\n\t\tif (callback) this._renderCallbacks.push(callback);\n\t\tenqueueRender(this);\n\t}\n};\n\n/**\n * Accepts `props` and `state`, and returns a new Virtual DOM tree to build.\n * Virtual DOM is generally constructed via [JSX](https://jasonformat.com/wtf-is-jsx).\n * @param {object} props Props (eg: JSX attributes) received from parent\n * element/component\n * @param {object} state The component's current state\n * @param {object} context Context object, as returned by the nearest\n * ancestor's `getChildContext()`\n * @returns {ComponentChildren | void}\n */\nBaseComponent.prototype.render = Fragment;\n\n/**\n * @param {import('./internal').VNode} vnode\n * @param {number | null} [childIndex]\n */\nexport function getDomSibling(vnode, childIndex) {\n\tif (childIndex == NULL) {\n\t\t// Use childIndex==null as a signal to resume the search from the vnode's sibling\n\t\treturn vnode._parent\n\t\t\t? getDomSibling(vnode._parent, vnode._index + 1)\n\t\t\t: NULL;\n\t}\n\n\tlet sibling;\n\tfor (; childIndex < vnode._children.length; childIndex++) {\n\t\tsibling = vnode._children[childIndex];\n\n\t\tif (sibling != NULL && sibling._dom != NULL) {\n\t\t\t// Since updateParentDomPointers keeps _dom pointer correct,\n\t\t\t// we can rely on _dom to tell us if this subtree contains a\n\t\t\t// rendered DOM node, and what the first rendered DOM node is\n\t\t\treturn sibling._dom;\n\t\t}\n\t}\n\n\t// If we get here, we have not found a DOM node in this vnode's children.\n\t// We must resume from this vnode's sibling (in it's parent _children array)\n\t// Only climb up and search the parent if we aren't searching through a DOM\n\t// VNode (meaning we reached the DOM parent of the original vnode that began\n\t// the search)\n\treturn typeof vnode.type == 'function' ? getDomSibling(vnode) : NULL;\n}\n\n/**\n * Trigger in-place re-rendering of a component.\n * @param {import('./internal').Component} component The component to rerender\n */\nfunction renderComponent(component) {\n\tlet oldVNode = component._vnode,\n\t\toldDom = oldVNode._dom,\n\t\tcommitQueue = [],\n\t\trefQueue = [];\n\n\tif (component._parentDom) {\n\t\tconst newVNode = assign({}, oldVNode);\n\t\tnewVNode._original = oldVNode._original + 1;\n\t\tif (options.vnode) options.vnode(newVNode);\n\n\t\tdiff(\n\t\t\tcomponent._parentDom,\n\t\t\tnewVNode,\n\t\t\toldVNode,\n\t\t\tcomponent._globalContext,\n\t\t\tcomponent._parentDom.namespaceURI,\n\t\t\toldVNode._flags & MODE_HYDRATE ? [oldDom] : NULL,\n\t\t\tcommitQueue,\n\t\t\toldDom == NULL ? getDomSibling(oldVNode) : oldDom,\n\t\t\t!!(oldVNode._flags & MODE_HYDRATE),\n\t\t\trefQueue\n\t\t);\n\n\t\tnewVNode._original = oldVNode._original;\n\t\tnewVNode._parent._children[newVNode._index] = newVNode;\n\t\tcommitRoot(commitQueue, newVNode, refQueue);\n\t\toldVNode._dom = oldVNode._parent = null;\n\n\t\tif (newVNode._dom != oldDom) {\n\t\t\tupdateParentDomPointers(newVNode);\n\t\t}\n\t}\n}\n\n/**\n * @param {import('./internal').VNode} vnode\n */\nfunction updateParentDomPointers(vnode) {\n\tif ((vnode = vnode._parent) != NULL && vnode._component != NULL) {\n\t\tvnode._dom = vnode._component.base = NULL;\n\t\tfor (let i = 0; i < vnode._children.length; i++) {\n\t\t\tlet child = vnode._children[i];\n\t\t\tif (child != NULL && child._dom != NULL) {\n\t\t\t\tvnode._dom = vnode._component.base = child._dom;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn updateParentDomPointers(vnode);\n\t}\n}\n\n/**\n * The render queue\n * @type {Array<import('./internal').Component>}\n */\nlet rerenderQueue = [];\n\n/*\n * The value of `Component.debounce` must asynchronously invoke the passed in callback. It is\n * important that contributors to Preact can consistently reason about what calls to `setState`, etc.\n * do, and when their effects will be applied. See the links below for some further reading on designing\n * asynchronous APIs.\n * * [Designing APIs for Asynchrony](https://blog.izs.me/2013/08/designing-apis-for-asynchrony)\n * * [Callbacks synchronous and asynchronous](https://blog.ometer.com/2011/07/24/callbacks-synchronous-and-asynchronous/)\n */\n\nlet prevDebounce;\n\nconst defer =\n\ttypeof Promise == 'function'\n\t\t? Promise.prototype.then.bind(Promise.resolve())\n\t\t: setTimeout;\n\n/**\n * Enqueue a rerender of a component\n * @param {import('./internal').Component} c The component to rerender\n */\nexport function enqueueRender(c) {\n\tif (\n\t\t(!c._dirty &&\n\t\t\t(c._dirty = true) &&\n\t\t\trerenderQueue.push(c) &&\n\t\t\t!process._rerenderCount++) ||\n\t\tprevDebounce != options.debounceRendering\n\t) {\n\t\tprevDebounce = options.debounceRendering;\n\t\t(prevDebounce || defer)(process);\n\t}\n}\n\n/**\n * @param {import('./internal').Component} a\n * @param {import('./internal').Component} b\n */\nconst depthSort = (a, b) => a._vnode._depth - b._vnode._depth;\n\n/** Flush the render queue by rerendering all queued components */\nfunction process() {\n\tlet c,\n\t\tl = 1;\n\n\t// Don't update `renderCount` yet. Keep its value non-zero to prevent unnecessary\n\t// process() calls from getting scheduled while `queue` is still being consumed.\n\twhile (rerenderQueue.length) {\n\t\t// Keep the rerender queue sorted by (depth, insertion order). The queue\n\t\t// will initially be sorted on the first iteration only if it has more than 1 item.\n\t\t//\n\t\t// New items can be added to the queue e.g. when rerendering a provider, so we want to\n\t\t// keep the order from top to bottom with those new items so we can handle them in a\n\t\t// single pass\n\t\tif (rerenderQueue.length > l) {\n\t\t\trerenderQueue.sort(depthSort);\n\t\t}\n\n\t\tc = rerenderQueue.shift();\n\t\tl = rerenderQueue.length;\n\n\t\tif (c._dirty) {\n\t\t\trenderComponent(c);\n\t\t}\n\t}\n\tprocess._rerenderCount = 0;\n}\n\nprocess._rerenderCount = 0;\n","import { IS_NON_DIMENSIONAL, NULL, SVG_NAMESPACE } from '../constants';\nimport options from '../options';\n\nfunction setStyle(style, key, value) {\n\tif (key[0] == '-') {\n\t\tstyle.setProperty(key, value == NULL ? '' : value);\n\t} else if (value == NULL) {\n\t\tstyle[key] = '';\n\t} else if (typeof value != 'number' || IS_NON_DIMENSIONAL.test(key)) {\n\t\tstyle[key] = value;\n\t} else {\n\t\tstyle[key] = value + 'px';\n\t}\n}\n\nconst CAPTURE_REGEX = /(PointerCapture)$|Capture$/i;\n\n// A logical clock to solve issues like https://github.com/preactjs/preact/issues/3927.\n// When the DOM performs an event it leaves micro-ticks in between bubbling up which means that\n// an event can trigger on a newly reated DOM-node while the event bubbles up.\n//\n// Originally inspired by Vue\n// (https://github.com/vuejs/core/blob/caeb8a68811a1b0f79/packages/runtime-dom/src/modules/events.ts#L90-L101),\n// but modified to use a logical clock instead of Date.now() in case event handlers get attached\n// and events get dispatched during the same millisecond.\n//\n// The clock is incremented after each new event dispatch. This allows 1 000 000 new events\n// per second for over 280 years before the value reaches Number.MAX_SAFE_INTEGER (2**53 - 1).\nlet eventClock = 0;\n\n/**\n * Set a property value on a DOM node\n * @param {import('../internal').PreactElement} dom The DOM node to modify\n * @param {string} name The name of the property to set\n * @param {*} value The value to set the property to\n * @param {*} oldValue The old value the property had\n * @param {string} namespace Whether or not this DOM node is an SVG node or not\n */\nexport function setProperty(dom, name, value, oldValue, namespace) {\n\tlet useCapture;\n\n\to: if (name == 'style') {\n\t\tif (typeof value == 'string') {\n\t\t\tdom.style.cssText = value;\n\t\t} else {\n\t\t\tif (typeof oldValue == 'string') {\n\t\t\t\tdom.style.cssText = oldValue = '';\n\t\t\t}\n\n\t\t\tif (oldValue) {\n\t\t\t\tfor (name in oldValue) {\n\t\t\t\t\tif (!(value && name in value)) {\n\t\t\t\t\t\tsetStyle(dom.style, name, '');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (value) {\n\t\t\t\tfor (name in value) {\n\t\t\t\t\tif (!oldValue || value[name] != oldValue[name]) {\n\t\t\t\t\t\tsetStyle(dom.style, name, value[name]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t// Benchmark for comparison: https://esbench.com/bench/574c954bdb965b9a00965ac6\n\telse if (name[0] == 'o' && name[1] == 'n') {\n\t\tuseCapture = name != (name = name.replace(CAPTURE_REGEX, '$1'));\n\t\tconst lowerCaseName = name.toLowerCase();\n\n\t\t// Infer correct casing for DOM built-in events:\n\t\tif (lowerCaseName in dom || name == 'onFocusOut' || name == 'onFocusIn')\n\t\t\tname = lowerCaseName.slice(2);\n\t\telse name = name.slice(2);\n\n\t\tif (!dom._listeners) dom._listeners = {};\n\t\tdom._listeners[name + useCapture] = value;\n\n\t\tif (value) {\n\t\t\tif (!oldValue) {\n\t\t\t\tvalue._attached = eventClock;\n\t\t\t\tdom.addEventListener(\n\t\t\t\t\tname,\n\t\t\t\t\tuseCapture ? eventProxyCapture : eventProxy,\n\t\t\t\t\tuseCapture\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tvalue._attached = oldValue._attached;\n\t\t\t}\n\t\t} else {\n\t\t\tdom.removeEventListener(\n\t\t\t\tname,\n\t\t\t\tuseCapture ? eventProxyCapture : eventProxy,\n\t\t\t\tuseCapture\n\t\t\t);\n\t\t}\n\t} else {\n\t\tif (namespace == SVG_NAMESPACE) {\n\t\t\t// Normalize incorrect prop usage for SVG:\n\t\t\t// - xlink:href / xlinkHref --> href (xlink:href was removed from SVG and isn't needed)\n\t\t\t// - className --> class\n\t\t\tname = name.replace(/xlink(H|:h)/, 'h').replace(/sName$/, 's');\n\t\t} else if (\n\t\t\tname != 'width' &&\n\t\t\tname != 'height' &&\n\t\t\tname != 'href' &&\n\t\t\tname != 'list' &&\n\t\t\tname != 'form' &&\n\t\t\t// Default value in browsers is `-1` and an empty string is\n\t\t\t// cast to `0` instead\n\t\t\tname != 'tabIndex' &&\n\t\t\tname != 'download' &&\n\t\t\tname != 'rowSpan' &&\n\t\t\tname != 'colSpan' &&\n\t\t\tname != 'role' &&\n\t\t\tname != 'popover' &&\n\t\t\tname in dom\n\t\t) {\n\t\t\ttry {\n\t\t\t\tdom[name] = value == NULL ? '' : value;\n\t\t\t\t// labelled break is 1b smaller here than a return statement (sorry)\n\t\t\t\tbreak o;\n\t\t\t} catch (e) {}\n\t\t}\n\n\t\t// aria- and data- attributes have no boolean representation.\n\t\t// A `false` value is different from the attribute not being\n\t\t// present, so we can't remove it. For non-boolean aria\n\t\t// attributes we could treat false as a removal, but the\n\t\t// amount of exceptions would cost too many bytes. On top of\n\t\t// that other frameworks generally stringify `false`.\n\n\t\tif (typeof value == 'function') {\n\t\t\t// never serialize functions as attribute values\n\t\t} else if (value != NULL && (value !== false || name[4] == '-')) {\n\t\t\tdom.setAttribute(name, name == 'popover' && value == true ? '' : value);\n\t\t} else {\n\t\t\tdom.removeAttribute(name);\n\t\t}\n\t}\n}\n\n/**\n * Create an event proxy function.\n * @param {boolean} useCapture Is the event handler for the capture phase.\n * @private\n */\nfunction createEventProxy(useCapture) {\n\t/**\n\t * Proxy an event to hooked event handlers\n\t * @param {import('../internal').PreactEvent} e The event object from the browser\n\t * @private\n\t */\n\treturn function (e) {\n\t\tif (this._listeners) {\n\t\t\tconst eventHandler = this._listeners[e.type + useCapture];\n\t\t\tif (e._dispatched == NULL) {\n\t\t\t\te._dispatched = eventClock++;\n\n\t\t\t\t// When `e._dispatched` is smaller than the time when the targeted event\n\t\t\t\t// handler was attached we know we have bubbled up to an element that was added\n\t\t\t\t// during patching the DOM.\n\t\t\t} else if (e._dispatched < eventHandler._attached) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treturn eventHandler(options.event ? options.event(e) : e);\n\t\t}\n\t};\n}\n\nconst eventProxy = createEventProxy(false);\nconst eventProxyCapture = createEventProxy(true);\n","import { enqueueRender } from './component';\nimport { NULL } from './constants';\n\nexport let i = 0;\n\nexport function createContext(defaultValue) {\n\tfunction Context(props) {\n\t\tif (!this.getChildContext) {\n\t\t\t/** @type {Set<import('./internal').Component> | null} */\n\t\t\tlet subs = new Set();\n\t\t\tlet ctx = {};\n\t\t\tctx[Context._id] = this;\n\n\t\t\tthis.getChildContext = () => ctx;\n\n\t\t\tthis.componentWillUnmount = () => {\n\t\t\t\tsubs = NULL;\n\t\t\t};\n\n\t\t\tthis.shouldComponentUpdate = function (_props) {\n\t\t\t\t// @ts-expect-error even\n\t\t\t\tif (this.props.value != _props.value) {\n\t\t\t\t\tsubs.forEach(c => {\n\t\t\t\t\t\tc._force = true;\n\t\t\t\t\t\tenqueueRender(c);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tthis.sub = c => {\n\t\t\t\tsubs.add(c);\n\t\t\t\tlet old = c.componentWillUnmount;\n\t\t\t\tc.componentWillUnmount = () => {\n\t\t\t\t\tif (subs) {\n\t\t\t\t\t\tsubs.delete(c);\n\t\t\t\t\t}\n\t\t\t\t\tif (old) old.call(c);\n\t\t\t\t};\n\t\t\t};\n\t\t}\n\n\t\treturn props.children;\n\t}\n\n\tContext._id = '__cC' + i++;\n\tContext._defaultValue = defaultValue;\n\n\t/** @type {import('./internal').FunctionComponent} */\n\tContext.Consumer = (props, contextValue) => {\n\t\treturn props.children(contextValue);\n\t};\n\n\t// we could also get rid of _contextRef entirely\n\tContext.Provider =\n\t\tContext._contextRef =\n\t\tContext.Consumer.contextType =\n\t\t\tContext;\n\n\treturn Context;\n}\n","import { diff, unmount, applyRef } from './index';\nimport { createVNode, Fragment } from '../create-element';\nimport {\n\tEMPTY_OBJ,\n\tEMPTY_ARR,\n\tINSERT_VNODE,\n\tMATCHED,\n\tUNDEFINED,\n\tNULL\n} from '../constants';\nimport { isArray } from '../util';\nimport { getDomSibling } from '../component';\n\n/**\n * @typedef {import('../internal').ComponentChildren} ComponentChildren\n * @typedef {import('../internal').Component} Component\n * @typedef {import('../internal').PreactElement} PreactElement\n * @typedef {import('../internal').VNode} VNode\n */\n\n/**\n * Diff the children of a virtual node\n * @param {PreactElement} parentDom The DOM element whose children are being\n * diffed\n * @param {ComponentChildren[]} renderResult\n * @param {VNode} newParentVNode The new virtual node whose children should be\n * diff'ed against oldParentVNode\n * @param {VNode} oldParentVNode The old virtual node whose children should be\n * diff'ed against newParentVNode\n * @param {object} globalContext The current context object - modified by\n * getChildContext\n * @param {string} namespace Current namespace of the DOM node (HTML, SVG, or MathML)\n * @param {Array<PreactElement>} excessDomChildren\n * @param {Array<Component>} commitQueue List of components which have callbacks\n * to invoke in commitRoot\n * @param {PreactElement} oldDom The current attached DOM element any new dom\n * elements should be placed around. Likely `null` on first render (except when\n * hydrating). Can be a sibling DOM element when diffing Fragments that have\n * siblings. In most cases, it starts out as `oldChildren[0]._dom`.\n * @param {boolean} isHydrating Whether or not we are in hydration\n * @param {any[]} refQueue an array of elements needed to invoke refs\n */\nexport function diffChildren(\n\tparentDom,\n\trenderResult,\n\tnewParentVNode,\n\toldParentVNode,\n\tglobalContext,\n\tnamespace,\n\texcessDomChildren,\n\tcommitQueue,\n\toldDom,\n\tisHydrating,\n\trefQueue\n) {\n\tlet i,\n\t\t/** @type {VNode} */\n\t\toldVNode,\n\t\t/** @type {VNode} */\n\t\tchildVNode,\n\t\t/** @type {PreactElement} */\n\t\tnewDom,\n\t\t/** @type {PreactElement} */\n\t\tfirstChildDom;\n\n\t// This is a compression of oldParentVNode!=null && oldParentVNode != EMPTY_OBJ && oldParentVNode._children || EMPTY_ARR\n\t// as EMPTY_OBJ._children should be `undefined`.\n\t/** @type {VNode[]} */\n\tlet oldChildren = (oldParentVNode && oldParentVNode._children) || EMPTY_ARR;\n\n\tlet newChildrenLength = renderResult.length;\n\n\toldDom = constructNewChildrenArray(\n\t\tnewParentVNode,\n\t\trenderResult,\n\t\toldChildren,\n\t\toldDom,\n\t\tnewChildrenLength\n\t);\n\n\tfor (i = 0; i < newChildrenLength; i++) {\n\t\tchildVNode = newParentVNode._children[i];\n\t\tif (childVNode == NULL) continue;\n\n\t\t// At this point, constructNewChildrenArray has assigned _index to be the\n\t\t// matchingIndex for this VNode's oldVNode (or -1 if there is no oldVNode).\n\t\tif (childVNode._index == -1) {\n\t\t\toldVNode = EMPTY_OBJ;\n\t\t} else {\n\t\t\toldVNode = oldChildren[childVNode._index] || EMPTY_OBJ;\n\t\t}\n\n\t\t// Update childVNode._index to its final index\n\t\tchildVNode._index = i;\n\n\t\t// Morph the old element into the new one, but don't append it to the dom yet\n\t\tlet result = diff(\n\t\t\tparentDom,\n\t\t\tchildVNode,\n\t\t\toldVNode,\n\t\t\tglobalContext,\n\t\t\tnamespace,\n\t\t\texcessDomChildren,\n\t\t\tcommitQueue,\n\t\t\toldDom,\n\t\t\tisHydrating,\n\t\t\trefQueue\n\t\t);\n\n\t\t// Adjust DOM nodes\n\t\tnewDom = childVNode._dom;\n\t\tif (childVNode.ref && oldVNode.ref != childVNode.ref) {\n\t\t\tif (oldVNode.ref) {\n\t\t\t\tapplyRef(oldVNode.ref, NULL, childVNode);\n\t\t\t}\n\t\t\trefQueue.push(\n\t\t\t\tchildVNode.ref,\n\t\t\t\tchildVNode._component || newDom,\n\t\t\t\tchildVNode\n\t\t\t);\n\t\t}\n\n\t\tif (firstChildDom == NULL && newDom != NULL) {\n\t\t\tfirstChildDom = newDom;\n\t\t}\n\n\t\tlet shouldPlace = !!(childVNode._flags & INSERT_VNODE);\n\t\tif (shouldPlace || oldVNode._children === childVNode._children) {\n\t\t\toldDom = insert(childVNode, oldDom, parentDom, shouldPlace);\n\t\t} else if (typeof childVNode.type == 'function' && result !== UNDEFINED) {\n\t\t\toldDom = result;\n\t\t} else if (newDom) {\n\t\t\toldDom = newDom.nextSibling;\n\t\t}\n\n\t\t// Unset diffing flags\n\t\tchildVNode._flags &= ~(INSERT_VNODE | MATCHED);\n\t}\n\n\tnewParentVNode._dom = firstChildDom;\n\n\treturn oldDom;\n}\n\n/**\n * @param {VNode} newParentVNode\n * @param {ComponentChildren[]} renderResult\n * @param {VNode[]} oldChildren\n */\nfunction constructNewChildrenArray(\n\tnewParentVNode,\n\trenderResult,\n\toldChildren,\n\toldDom,\n\tnewChildrenLength\n) {\n\t/** @type {number} */\n\tlet i;\n\t/** @type {VNode} */\n\tlet childVNode;\n\t/** @type {VNode} */\n\tlet oldVNode;\n\n\tlet oldChildrenLength = oldChildren.length,\n\t\tremainingOldChildren = oldChildrenLength;\n\n\tlet skew = 0;\n\n\tnewParentVNode._children = new Array(newChildrenLength);\n\tfor (i = 0; i < newChildrenLength; i++) {\n\t\t// @ts-expect-error We are reusing the childVNode variable to hold both the\n\t\t// pre and post normalized childVNode\n\t\tchildVNode = renderResult[i];\n\n\t\tif (\n\t\t\tchildVNode == NULL ||\n\t\t\ttypeof childVNode == 'boolean' ||\n\t\t\ttypeof childVNode == 'function'\n\t\t) {\n\t\t\tnewParentVNode._children[i] = NULL;\n\t\t\tcontinue;\n\t\t}\n\t\t// If this newVNode is being reused (e.g. <div>{reuse}{reuse}</div>) in the same diff,\n\t\t// or we are rendering a component (e.g. setState) copy the oldVNodes so it can have\n\t\t// it's own DOM & etc. pointers\n\t\telse if (\n\t\t\ttypeof childVNode == 'string' ||\n\t\t\ttypeof childVNode == 'number' ||\n\t\t\t// eslint-disable-next-line valid-typeof\n\t\t\ttypeof childVNode == 'bigint' ||\n\t\t\tchildVNode.constructor == String\n\t\t) {\n\t\t\tchildVNode = newParentVNode._children[i] = createVNode(\n\t\t\t\tNULL,\n\t\t\t\tchildVNode,\n\t\t\t\tNULL,\n\t\t\t\tNULL,\n\t\t\t\tNULL\n\t\t\t);\n\t\t} else if (isArray(childVNode)) {\n\t\t\tchildVNode = newParentVNode._children[i] = createVNode(\n\t\t\t\tFragment,\n\t\t\t\t{ children: childVNode },\n\t\t\t\tNULL,\n\t\t\t\tNULL,\n\t\t\t\tNULL\n\t\t\t);\n\t\t} else if (childVNode.constructor === UNDEFINED && childVNode._depth > 0) {\n\t\t\t// VNode is already in use, clone it. This can happen in the following\n\t\t\t// scenario:\n\t\t\t// const reuse = <div />\n\t\t\t// <div>{reuse}<span />{reuse}</div>\n\t\t\tchildVNode = newParentVNode._children[i] = createVNode(\n\t\t\t\tchildVNode.type,\n\t\t\t\tchildVNode.props,\n\t\t\t\tchildVNode.key,\n\t\t\t\tchildVNode.ref ? childVNode.ref : NULL,\n\t\t\t\tchildVNode._original\n\t\t\t);\n\t\t} else {\n\t\t\tnewParentVNode._children[i] = childVNode;\n\t\t}\n\n\t\tconst skewedIndex = i + skew;\n\t\tchildVNode._parent = newParentVNode;\n\t\tchildVNode._depth = newParentVNode._depth + 1;\n\n\t\t// Temporarily store the matchingIndex on the _index property so we can pull\n\t\t// out the oldVNode in diffChildren. We'll override this to the VNode's\n\t\t// final index after using this property to get the oldVNode\n\t\tconst matchingIndex = (childVNode._index = findMatchingIndex(\n\t\t\tchildVNode,\n\t\t\toldChildren,\n\t\t\tskewedIndex,\n\t\t\tremainingOldChildren\n\t\t));\n\n\t\toldVNode = NULL;\n\t\tif (matchingIndex != -1) {\n\t\t\toldVNode = oldChildren[matchingIndex];\n\t\t\tremainingOldChildren--;\n\t\t\tif (oldVNode) {\n\t\t\t\toldVNode._flags |= MATCHED;\n\t\t\t}\n\t\t}\n\n\t\t// Here, we define isMounting for the purposes of the skew diffing\n\t\t// algorithm. Nodes that are unsuspending are considered mounting and we detect\n\t\t// this by checking if oldVNode._original == null\n\t\tconst isMounting = oldVNode == NULL || oldVNode._original == NULL;\n\n\t\tif (isMounting) {\n\t\t\tif (matchingIndex == -1) {\n\t\t\t\t// When the array of children is growing we need to decrease the skew\n\t\t\t\t// as we are adding a new element to the array.\n\t\t\t\t// Example:\n\t\t\t\t// [1, 2, 3] --> [0, 1, 2, 3]\n\t\t\t\t// oldChildren newChildren\n\t\t\t\t//\n\t\t\t\t// The new element is at index 0, so our skew is 0,\n\t\t\t\t// we need to decrease the skew as we are adding a new element.\n\t\t\t\t// The decrease will cause us to compare the element at position 1\n\t\t\t\t// with value 1 with the element at position 0 with value 0.\n\t\t\t\t//\n\t\t\t\t// A linear concept is applied when the array is shrinking,\n\t\t\t\t// if the length is unchanged we can assume that no skew\n\t\t\t\t// changes are needed.\n\t\t\t\tif (newChildrenLength > oldChildrenLength) {\n\t\t\t\t\tskew--;\n\t\t\t\t} else if (newChildrenLength < oldChildrenLength) {\n\t\t\t\t\tskew++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// If we are mounting a DOM VNode, mark it for insertion\n\t\t\tif (typeof childVNode.type != 'function') {\n\t\t\t\tchildVNode._flags |= INSERT_VNODE;\n\t\t\t}\n\t\t} else if (matchingIndex != skewedIndex) {\n\t\t\t// When we move elements around i.e. [0, 1, 2] --> [1, 0, 2]\n\t\t\t// --> we diff 1, we find it at position 1 while our skewed index is 0 and our skew is 0\n\t\t\t// we set the skew to 1 as we found an offset.\n\t\t\t// --> we diff 0, we find it at position 0 while our skewed index is at 2 and our skew is 1\n\t\t\t// this makes us increase the skew again.\n\t\t\t// --> we diff 2, we find it at position 2 while our skewed index is at 4 and our skew is 2\n\t\t\t//\n\t\t\t// this becomes an optimization question where currently we see a 1 element offset as an insertion\n\t\t\t// or deletion i.e. we optimize for [0, 1, 2] --> [9, 0, 1, 2]\n\t\t\t// while a more than 1 offset we see as a swap.\n\t\t\t// We could probably build heuristics for having an optimized course of action here as well, but\n\t\t\t// might go at the cost of some bytes.\n\t\t\t//\n\t\t\t// If we wanted to optimize for i.e. only swaps we'd just do the last two code-branches and have\n\t\t\t// only the first item be a re-scouting and all the others fall in their skewed counter-part.\n\t\t\t// We could also further optimize for swaps\n\t\t\tif (matchingIndex == skewedIndex - 1) {\n\t\t\t\tskew--;\n\t\t\t} else if (matchingIndex == skewedIndex + 1) {\n\t\t\t\tskew++;\n\t\t\t} else {\n\t\t\t\tif (matchingIndex > skewedIndex) {\n\t\t\t\t\tskew--;\n\t\t\t\t} else {\n\t\t\t\t\tskew++;\n\t\t\t\t}\n\n\t\t\t\t// Move this VNode's DOM if the original index (matchingIndex) doesn't\n\t\t\t\t// match the new skew index (i + new skew)\n\t\t\t\t// In the former two branches we know that it matches after skewing\n\t\t\t\tchildVNode._flags |= INSERT_VNODE;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Remove remaining oldChildren if there are any. Loop forwards so that as we\n\t// unmount DOM from the beginning of the oldChildren, we can adjust oldDom to\n\t// point to the next child, which needs to be the first DOM node that won't be\n\t// unmounted.\n\tif (remainingOldChildren) {\n\t\tfor (i = 0; i < oldChildrenLength; i++) {\n\t\t\toldVNode = oldChildren[i];\n\t\t\tif (oldVNode != NULL && (oldVNode._flags & MATCHED) == 0) {\n\t\t\t\tif (oldVNode._dom == oldDom) {\n\t\t\t\t\toldDom = getDomSibling(oldVNode);\n\t\t\t\t}\n\n\t\t\t\tunmount(oldVNode, oldVNode);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn oldDom;\n}\n\n/**\n * @param {VNode} parentVNode\n * @param {PreactElement} oldDom\n * @param {PreactElement} parentDom\n * @param {boolean} shouldPlace\n * @returns {PreactElement}\n */\nfunction insert(parentVNode, oldDom, parentDom, shouldPlace) {\n\t// Note: VNodes in nested suspended trees may be missing _children.\n\n\tif (typeof parentVNode.type == 'function') {\n\t\tlet children = parentVNode._children;\n\t\tfor (let i = 0; children && i < children.length; i++) {\n\t\t\tif (children[i]) {\n\t\t\t\t// If we enter this code path on sCU bailout, where we copy\n\t\t\t\t// oldVNode._children to newVNode._children, we need to update the old\n\t\t\t\t// children's _parent pointer to point to the newVNode (parentVNode\n\t\t\t\t// here).\n\t\t\t\tchildren[i]._parent = parentVNode;\n\t\t\t\toldDom = insert(children[i], oldDom, parentDom, shouldPlace);\n\t\t\t}\n\t\t}\n\n\t\treturn oldDom;\n\t} else if (parentVNode._dom != oldDom) {\n\t\tif (shouldPlace) {\n\t\t\tif (oldDom && parentVNode.type && !oldDom.parentNode) {\n\t\t\t\toldDom = getDomSibling(parentVNode);\n\t\t\t}\n\t\t\tparentDom.insertBefore(parentVNode._dom, oldDom || NULL);\n\t\t}\n\t\toldDom = parentVNode._dom;\n\t}\n\n\tdo {\n\t\toldDom = oldDom && oldDom.nextSibling;\n\t} while (oldDom != NULL && oldDom.nodeType == 8);\n\n\treturn oldDom;\n}\n\n/**\n * Flatten and loop through the children of a virtual node\n * @param {ComponentChildren} children The unflattened children of a virtual\n * node\n * @returns {VNode[]}\n */\nexport function toChildArray(children, out) {\n\tout = out || [];\n\tif (children == NULL || typeof children == 'boolean') {\n\t} else if (isArray(children)) {\n\t\tchildren.some(child => {\n\t\t\ttoChildArray(child, out);\n\t\t});\n\t} else {\n\t\tout.push(children);\n\t}\n\treturn out;\n}\n\n/**\n * @param {VNode} childVNode\n * @param {VNode[]} oldChildren\n * @param {number} skewedIndex\n * @param {number} remainingOldChildren\n * @returns {number}\n */\nfunction findMatchingIndex(\n\tchildVNode,\n\toldChildren,\n\tskewedIndex,\n\tremainingOldChildren\n) {\n\tconst key = childVNode.key;\n\tconst type = childVNode.type;\n\tlet oldVNode = oldChildren[skewedIndex];\n\tconst matched = oldVNode != NULL && (oldVNode._flags & MATCHED) == 0;\n\n\t// We only need to perform a search if there are more children\n\t// (remainingOldChildren) to search. However, if the oldVNode we just looked\n\t// at skewedIndex was not already used in this diff, then there must be at\n\t// least 1 other (so greater than 1) remainingOldChildren to attempt to match\n\t// against. So the following condition checks that ensuring\n\t// remainingOldChildren > 1 if the oldVNode is not already used/matched. Else\n\t// if the oldVNode was null or matched, then there could needs to be at least\n\t// 1 (aka `remainingOldChildren > 0`) children to find and compare against.\n\t//\n\t// If there is an unkeyed functional VNode, that isn't a built-in like our Fragment,\n\t// we should not search as we risk re-using state of an unrelated VNode. (reverted for now)\n\tlet shouldSearch =\n\t\t// (typeof type != 'function' || type === Fragment || key) &&\n\t\tremainingOldChildren > (matched ? 1 : 0);\n\n\tif (\n\t\t(oldVNode === NULL && key == null) ||\n\t\t(matched && key == oldVNode.key && type == oldVNode.type)\n\t) {\n\t\treturn skewedIndex;\n\t} else if (shouldSearch) {\n\t\tlet x = skewedIndex - 1;\n\t\tlet y = skewedIndex + 1;\n\t\twhile (x >= 0 || y < oldChildren.length) {\n\t\t\tconst childIndex = x >= 0 ? x-- : y++;\n\t\t\toldVNode = oldChildren[childIndex];\n\t\t\tif (\n\t\t\t\toldVNode != NULL &&\n\t\t\t\t(oldVNode._flags & MATCHED) == 0 &&\n\t\t\t\tkey == oldVNode.key &&\n\t\t\t\ttype == oldVNode.type\n\t\t\t) {\n\t\t\t\treturn childIndex;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn -1;\n}\n","import {\n\tEMPTY_OBJ,\n\tMATH_NAMESPACE,\n\tMODE_HYDRATE,\n\tMODE_SUSPENDED,\n\tNULL,\n\tRESET_MODE,\n\tSVG_NAMESPACE,\n\tUNDEFINED,\n\tXHTML_NAMESPACE\n} from '../constants';\nimport { BaseComponent, getDomSibling } from '../component';\nimport { Fragment } from '../create-element';\nimport { diffChildren } from './children';\nimport { setProperty } from './props';\nimport { assign, isArray, removeNode, slice } from '../util';\nimport options from '../options';\n\n/**\n * @typedef {import('../internal').ComponentChildren} ComponentChildren\n * @typedef {import('../internal').Component} Component\n * @typedef {import('../internal').PreactElement} PreactElement\n * @typedef {import('../internal').VNode} VNode\n */\n\n/**\n * @template {any} T\n * @typedef {import('../internal').Ref<T>} Ref<T>\n */\n\n/**\n * Diff two virtual nodes and apply proper changes to the DOM\n * @param {PreactElement} parentDom The parent of the DOM element\n * @param {VNode} newVNode The new virtual node\n * @param {VNode} oldVNode The old virtual node\n * @param {object} globalContext The current context object. Modified by\n * getChildContext\n * @param {string} namespace Current namespace of the DOM node (HTML, SVG, or MathML)\n * @param {Array<PreactElement>} excessDomChildren\n * @param {Array<Component>} commitQueue List of components which have callbacks\n * to invoke in commitRoot\n * @param {PreactElement} oldDom The current attached DOM element any new dom\n * elements should be placed around. Likely `null` on first render (except when\n * hydrating). Can be a sibling DOM element when diffing Fragments that have\n * siblings. In most cases, it starts out as `oldChildren[0]._dom`.\n * @param {boolean} isHydrating Whether or not we are in hydration\n * @param {any[]} refQueue an array of elements needed to invoke refs\n */\nexport function diff(\n\tparentDom,\n\tnewVNode,\n\toldVNode,\n\tglobalContext,\n\tnamespace,\n\texcessDomChildren,\n\tcommitQueue,\n\toldDom,\n\tisHydrating,\n\trefQueue\n) {\n\t/** @type {any} */\n\tlet tmp,\n\t\tnewType = newVNode.type;\n\n\t// When passing through createElement it assigns the object\n\t// constructor as undefined. This to prevent JSON-injection.\n\tif (newVNode.constructor !== UNDEFINED) return NULL;\n\n\t// If the previous diff bailed out, resume creating/hydrating.\n\tif (oldVNode._flags & MODE_SUSPENDED) {\n\t\tisHydrating = !!(oldVNode._flags & MODE_HYDRATE);\n\t\toldDom = newVNode._dom = oldVNode._dom;\n\t\texcessDomChildren = [oldDom];\n\t}\n\n\tif ((tmp = options._diff)) tmp(newVNode);\n\n\touter: if (typeof newType == 'function') {\n\t\ttry {\n\t\t\tlet c, isNew, oldProps, oldState, snapshot, clearProcessingException;\n\t\t\tlet newProps = newVNode.props;\n\t\t\tconst isClassComponent =\n\t\t\t\t'prototype' in newType && newType.prototype.render;\n\n\t\t\t// Necessary for createContext api. Setting this property will pass\n\t\t\t// the context value as `this.context` just for this component.\n\t\t\ttmp = newType.contextType;\n\t\t\tlet provider = tmp && globalContext[tmp._id];\n\t\t\tlet componentContext = tmp\n\t\t\t\t? provider\n\t\t\t\t\t? provider.props.value\n\t\t\t\t\t: tmp._defaultValue\n\t\t\t\t: globalContext;\n\n\t\t\t// Get component and set it to `c`\n\t\t\tif (oldVNode._component) {\n\t\t\t\tc = newVNode._component = oldVNode._component;\n\t\t\t\tclearProcessingException = c._processingException = c._pendingError;\n\t\t\t} else {\n\t\t\t\t// Instantiate the new component\n\t\t\t\tif (isClassComponent) {\n\t\t\t\t\t// @ts-expect-error The check above verifies that newType is suppose to be constructed\n\t\t\t\t\tnewVNode._component = c = new newType(newProps, componentContext); // eslint-disable-line new-cap\n\t\t\t\t} else {\n\t\t\t\t\t// @ts-expect-error Trust me, Component implements the interface we want\n\t\t\t\t\tnewVNode._component = c = new BaseComponent(\n\t\t\t\t\t\tnewProps,\n\t\t\t\t\t\tcomponentContext\n\t\t\t\t\t);\n\t\t\t\t\tc.constructor = newType;\n\t\t\t\t\tc.render = doRender;\n\t\t\t\t}\n\t\t\t\tif (provider) provider.sub(c);\n\n\t\t\t\tif (!c.state) c.state = {};\n\t\t\t\tc._globalContext = globalContext;\n\t\t\t\tisNew = c._dirty = true;\n\t\t\t\tc._renderCallbacks = [];\n\t\t\t\tc._stateCallbacks = [];\n\t\t\t}\n\n\t\t\t// Invoke getDerivedStateFromProps\n\t\t\tif (isClassComponent && c._nextState == NULL) {\n\t\t\t\tc._nextState = c.state;\n\t\t\t}\n\n\t\t\tif (isClassComponent && newType.getDerivedStateFromProps != NULL) {\n\t\t\t\tif (c._nextState == c.state) {\n\t\t\t\t\tc._nextState = assign({}, c._nextState);\n\t\t\t\t}\n\n\t\t\t\tassign(\n\t\t\t\t\tc._nextState,\n\t\t\t\t\tnewType.getDerivedStateFromProps(newProps, c._nextState)\n\t\t\t\t);\n\t\t\t}\n\n\t\t\toldProps = c.props;\n\t\t\toldState = c.state;\n\t\t\tc._vnode = newVNode;\n\n\t\t\t// Invoke pre-render lifecycle methods\n\t\t\tif (isNew) {\n\t\t\t\tif (\n\t\t\t\t\tisClassComponent &&\n\t\t\t\t\tnewType.getDerivedStateFromProps == NULL &&\n\t\t\t\t\tc.componentWillMount != NULL\n\t\t\t\t) {\n\t\t\t\t\tc.componentWillMount();\n\t\t\t\t}\n\n\t\t\t\tif (isClassComponent && c.componentDidMount != NULL) {\n\t\t\t\t\tc._renderCallbacks.push(c.componentDidMount);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (\n\t\t\t\t\tisClassComponent &&\n\t\t\t\t\tnewType.getDerivedStateFromProps == NULL &&\n\t\t\t\t\tnewProps !== oldProps &&\n\t\t\t\t\tc.componentWillReceiveProps != NULL\n\t\t\t\t) {\n\t\t\t\t\tc.componentWillReceiveProps(newProps, componentContext);\n\t\t\t\t}\n\n\t\t\t\tif (\n\t\t\t\t\tnewVNode._original == oldVNode._original ||\n\t\t\t\t\t(!c._force &&\n\t\t\t\t\t\tc.shouldComponentUpdate != NULL &&\n\t\t\t\t\t\tc.shouldComponentUpdate(\n\t\t\t\t\t\t\tnewProps,\n\t\t\t\t\t\t\tc._nextState,\n\t\t\t\t\t\t\tcomponentContext\n\t\t\t\t\t\t) === false)\n\t\t\t\t) {\n\t\t\t\t\t// More info about this here: https://gist.github.com/JoviDeCroock/bec5f2ce93544d2e6070ef8e0036e4e8\n\t\t\t\t\tif (newVNode._original != oldVNode._original) {\n\t\t\t\t\t\t// When we are dealing with a bail because of sCU we have to update\n\t\t\t\t\t\t// the props, state and dirty-state.\n\t\t\t\t\t\t// when we are dealing with strict-equality we don't as the child could still\n\t\t\t\t\t\t// be dirtied see #3883\n\t\t\t\t\t\tc.props = newProps;\n\t\t\t\t\t\tc.state = c._nextState;\n\t\t\t\t\t\tc._dirty = false;\n\t\t\t\t\t}\n\n\t\t\t\t\tnewVNode._dom = oldVNode._dom;\n\t\t\t\t\tnewVNode._children = oldVNode._children;\n\t\t\t\t\tnewVNode._children.some(vnode => {\n\t\t\t\t\t\tif (vnode) vnode._parent = newVNode;\n\t\t\t\t\t});\n\n\t\t\t\t\tfor (let i = 0; i < c._stateCallbacks.length; i++) {\n\t\t\t\t\t\tc._renderCallbacks.push(c._stateCallbacks[i]);\n\t\t\t\t\t}\n\t\t\t\t\tc._stateCallbacks = [];\n\n\t\t\t\t\tif (c._renderCallbacks.length) {\n\t\t\t\t\t\tcommitQueue.push(c);\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak outer;\n\t\t\t\t}\n\n\t\t\t\tif (c.componentWillUpdate != NULL) {\n\t\t\t\t\tc.componentWillUpdate(newProps, c._nextState, componentContext);\n\t\t\t\t}\n\n\t\t\t\tif (isClassComponent && c.componentDidUpdate != NULL) {\n\t\t\t\t\tc._renderCallbacks.push(() => {\n\t\t\t\t\t\tc.componentDidUpdate(oldProps, oldState, snapshot);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tc.context = componentContext;\n\t\t\tc.props = newProps;\n\t\t\tc._parentDom = parentDom;\n\t\t\tc._force = false;\n\n\t\t\tlet renderHook = options._render,\n\t\t\t\tcount = 0;\n\t\t\tif (isClassComponent) {\n\t\t\t\tc.state = c._nextState;\n\t\t\t\tc._dirty = false;\n\n\t\t\t\tif (renderHook) renderHook(newVNode);\n\n\t\t\t\ttmp = c.render(c.props, c.state, c.context);\n\n\t\t\t\tfor (let i = 0; i < c._stateCallbacks.length; i++) {\n\t\t\t\t\tc._renderCallbacks.push(c._stateCallbacks[i]);\n\t\t\t\t}\n\t\t\t\tc._stateCallbacks = [];\n\t\t\t} else {\n\t\t\t\tdo {\n\t\t\t\t\tc._dirty = false;\n\t\t\t\t\tif (renderHook) renderHook(newVNode);\n\n\t\t\t\t\ttmp = c.render(c.props, c.state, c.context);\n\n\t\t\t\t\t// Handle setState called in render, see #2553\n\t\t\t\t\tc.state = c._nextState;\n\t\t\t\t} while (c._dirty && ++count < 25);\n\t\t\t}\n\n\t\t\t// Handle setState called in render, see #2553\n\t\t\tc.state = c._nextState;\n\n\t\t\tif (c.getChildContext != NULL) {\n\t\t\t\tglobalContext = assign(assign({}, globalContext), c.getChildContext());\n\t\t\t}\n\n\t\t\tif (isClassComponent && !isNew && c.getSnapshotBeforeUpdate != NULL) {\n\t\t\t\tsnapshot = c.getSnapshotBeforeUpdate(oldProps, oldState);\n\t\t\t}\n\n\t\t\tlet isTopLevelFragment =\n\t\t\t\ttmp != NULL && tmp.type === Fragment && tmp.key == NULL;\n\t\t\tlet renderResult = tmp;\n\n\t\t\tif (isTopLevelFragment) {\n\t\t\t\trenderResult = cloneNode(tmp.props.children);\n\t\t\t}\n\n\t\t\toldDom = diffChildren(\n\t\t\t\tparentDom,\n\t\t\t\tisArray(renderResult) ? renderResult : [renderResult],\n\t\t\t\tnewVNode,\n\t\t\t\toldVNode,\n\t\t\t\tglobalContext,\n\t\t\t\tnamespace,\n\t\t\t\texcessDomChildren,\n\t\t\t\tcommitQueue,\n\t\t\t\toldDom,\n\t\t\t\tisHydrating,\n\t\t\t\trefQueue\n\t\t\t);\n\n\t\t\tc.base = newVNode._dom;\n\n\t\t\t// We successfully rendered this VNode, unset any stored hydration/bailout state:\n\t\t\tnewVNode._flags &= RESET_MODE;\n\n\t\t\tif (c._renderCallbacks.length) {\n\t\t\t\tcommitQueue.push(c);\n\t\t\t}\n\n\t\t\tif (clearProcessingException) {\n\t\t\t\tc._pendingError = c._processingException = NULL;\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tnewVNode._original = NULL;\n\t\t\t// if hydrating or creating initial tree, bailout preserves DOM:\n\t\t\tif (isHydrating || excessDomChildren != NULL) {\n\t\t\t\tif (e.then) {\n\t\t\t\t\tnewVNode._flags |= isHydrating\n\t\t\t\t\t\t? MODE_HYDRATE | MODE_SUSPENDED\n\t\t\t\t\t\t: MODE_SUSPENDED;\n\n\t\t\t\t\twhile (oldDom && oldDom.nodeType == 8 && oldDom.nextSibling) {\n\t\t\t\t\t\toldDom = oldDom.nextSibling;\n\t\t\t\t\t}\n\n\t\t\t\t\texcessDomChildren[excessDomChildren.indexOf(oldDom)] = NULL;\n\t\t\t\t\tnewVNode._dom = oldDom;\n\t\t\t\t} else {\n\t\t\t\t\tfor (let i = excessDomChildren.length; i--; ) {\n\t\t\t\t\t\tremoveNode(excessDomChildren[i]);\n\t\t\t\t\t}\n\t\t\t\t\tmarkAsForce(newVNode);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tnewVNode._dom = oldVNode._dom;\n\t\t\t\tnewVNode._children = oldVNode._children;\n\t\t\t\tif (!e.then) markAsForce(newVNode);\n\t\t\t}\n\t\t\toptions._catchError(e, newVNode, oldVNode);\n\t\t}\n\t} else if (\n\t\texcessDomChildren == NULL &&\n\t\tnewVNode._original == oldVNode._original\n\t) {\n\t\tnewVNode._children = oldVNode._children;\n\t\tnewVNode._dom = oldVNode._dom;\n\t} else {\n\t\toldDom = newVNode._dom = diffElementNodes(\n\t\t\toldVNode._dom,\n\t\t\tnewVNode,\n\t\t\toldVNode,\n\t\t\tglobalContext,\n\t\t\tnamespace,\n\t\t\texcessDomChildren,\n\t\t\tcommitQueue,\n\t\t\tisHydrating,\n\t\t\trefQueue\n\t\t);\n\t}\n\n\tif ((tmp = options.diffed)) tmp(newVNode);\n\n\treturn newVNode._flags & MODE_SUSPENDED ? undefined : oldDom;\n}\n\nfunction markAsForce(vnode) {\n\tif (vnode && vnode._component) vnode._component._force = true;\n\tif (vnode && vnode._children) vnode._children.forEach(markAsForce);\n}\n\n/**\n * @param {Array<Component>} commitQueue List of components\n * which have callbacks to invoke in commitRoot\n * @param {VNode} root\n */\nexport function commitRoot(commitQueue, root, refQueue) {\n\tfor (let i = 0; i < refQueue.length; i++) {\n\t\tapplyRef(refQueue[i], refQueue[++i], refQueue[++i]);\n\t}\n\n\tif (options._commit) options._commit(root, commitQueue);\n\n\tcommitQueue.some(c => {\n\t\ttry {\n\t\t\t// @ts-expect-error Reuse the commitQueue variable here so the type changes\n\t\t\tcommitQueue = c._renderCallbacks;\n\t\t\tc._renderCallbacks = [];\n\t\t\tcommitQueue.some(cb => {\n\t\t\t\t// @ts-expect-error See above comment on commitQueue\n\t\t\t\tcb.call(c);\n\t\t\t});\n\t\t} catch (e) {\n\t\t\toptions._catchError(e, c._vnode);\n\t\t}\n\t});\n}\n\nfunction cloneNode(node) {\n\tif (\n\t\ttypeof node != 'object' ||\n\t\tnode == NULL ||\n\t\t(node._depth && node._depth > 0)\n\t) {\n\t\treturn node;\n\t}\n\n\tif (isArray(node)) {\n\t\treturn node.map(cloneNode);\n\t}\n\n\treturn assign({}, node);\n}\n\n/**\n * Diff two virtual nodes representing DOM element\n * @param {PreactElement} dom The DOM element representing the virtual nodes\n * being diffed\n * @param {VNode} newVNode The new virtual node\n * @param {VNode} oldVNode The old virtual node\n * @param {object} globalContext The current context object\n * @param {string} namespace Current namespace of the DOM node (HTML, SVG, or MathML)\n * @param {Array<PreactElement>} excessDomChildren\n * @param {Array<Component>} commitQueue List of components which have callbacks\n * to invoke in commitRoot\n * @param {boolean} isHydrating Whether or not we are in hydration\n * @param {any[]} refQueue an array of elements needed to invoke refs\n * @returns {PreactElement}\n */\nfunction diffElementNodes(\n\tdom,\n\tnewVNode,\n\toldVNode,\n\tglobalContext,\n\tnamespace,\n\texcessDomChildren,\n\tcommitQueue,\n\tisHydrating,\n\trefQueue\n) {\n\tlet oldProps = oldVNode.props || EMPTY_OBJ;\n\tlet newProps = newVNode.props;\n\tlet nodeType = /** @type {string} */ (newVNode.type);\n\t/** @type {any} */\n\tlet i;\n\t/** @type {{ __html?: string }} */\n\tlet newHtml;\n\t/** @type {{ __html?: string }} */\n\tlet oldHtml;\n\t/** @type {ComponentChildren} */\n\tlet newChildren;\n\tlet value;\n\tlet inputValue;\n\tlet checked;\n\n\t// Tracks entering and exiting namespaces when descending through the tree.\n\tif (nodeType == 'svg') namespace = SVG_NAMESPACE;\n\telse if (nodeType == 'math') namespace = MATH_NAMESPACE;\n\telse if (!namespace) namespace = XHTML_NAMESPACE;\n\n\tif (excessDomChildren != NULL) {\n\t\tfor (i = 0; i < excessDomChildren.length; i++) {\n\t\t\tvalue = excessDomChildren[i];\n\n\t\t\t// if newVNode matches an element in excessDomChildren or the `dom`\n\t\t\t// argument matches an element in excessDomChildren, remove it from\n\t\t\t// excessDomChildren so it isn't later removed in diffChildren\n\t\t\tif (\n\t\t\t\tvalue &&\n\t\t\t\t'setAttribute' in value == !!nodeType &&\n\t\t\t\t(nodeType ? value.localName == nodeType : value.nodeType == 3)\n\t\t\t) {\n\t\t\t\tdom = value;\n\t\t\t\texcessDomChildren[i] = NULL;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (dom == NULL) {\n\t\tif (nodeType == NULL) {\n\t\t\treturn document.createTextNode(newProps);\n\t\t}\n\n\t\tdom = document.createElementNS(\n\t\t\tnamespace,\n\t\t\tnodeType,\n\t\t\tnewProps.is && newProps\n\t\t);\n\n\t\t// we are creating a new node, so we can assume this is a new subtree (in\n\t\t// case we are hydrating), this deopts the hydrate\n\t\tif (isHydrating) {\n\t\t\tif (options._hydrationMismatch)\n\t\t\t\toptions._hydrationMismatch(newVNode, excessDomChildren);\n\t\t\tisHydrating = false;\n\t\t}\n\t\t// we created a new parent, so none of the previously attached children can be reused:\n\t\texcessDomChildren = NULL;\n\t}\n\n\tif (nodeType == NULL) {\n\t\t// During hydration, we still have to split merged text from SSR'd HTML.\n\t\tif (oldProps !== newProps && (!isHydrating || dom.data != newProps)) {\n\t\t\tdom.data = newProps;\n\t\t}\n\t} else {\n\t\t// If excessDomChildren was not null, repopulate it with the current element's children:\n\t\texcessDomChildren = excessDomChildren && slice.call(dom.childNodes);\n\n\t\t// If we are in a situation where we are not hydrating but are using\n\t\t// existing DOM (e.g. replaceNode) we should read the existing DOM\n\t\t// attributes to diff them\n\t\tif (!isHydrating && excessDomChildren != NULL) {\n\t\t\toldProps = {};\n\t\t\tfor (i = 0; i < dom.attributes.length; i++) {\n\t\t\t\tvalue = dom.attributes[i];\n\t\t\t\toldProps[value.name] = value.value;\n\t\t\t}\n\t\t}\n\n\t\tfor (i in oldProps) {\n\t\t\tvalue = oldProps[i];\n\t\t\tif (i == 'children') {\n\t\t\t} else if (i == 'dangerouslySetInnerHTML') {\n\t\t\t\toldHtml = value;\n\t\t\t} else if (!(i in newProps)) {\n\t\t\t\tif (\n\t\t\t\t\t(i == 'value' && 'defaultValue' in newProps) ||\n\t\t\t\t\t(i == 'checked' && 'defaultChecked' in newProps)\n\t\t\t\t) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tsetProperty(dom, i, NULL, value, namespace);\n\t\t\t}\n\t\t}\n\n\t\t// During hydration, props are not diffed at all (including dangerouslySetInnerHTML)\n\t\t// @TODO we should warn in debug mode when props don't match here.\n\t\tfor (i in newProps) {\n\t\t\tvalue = newProps[i];\n\t\t\tif (i == 'children') {\n\t\t\t\tnewChildren = value;\n\t\t\t} else if (i == 'dangerouslySetInnerHTML') {\n\t\t\t\tnewHtml = value;\n\t\t\t} else if (i == 'value') {\n\t\t\t\tinputValue = value;\n\t\t\t} else if (i == 'checked') {\n\t\t\t\tchecked = value;\n\t\t\t} else if (\n\t\t\t\t(!isHydrating || typeof value == 'function') &&\n\t\t\t\toldProps[i] !== value\n\t\t\t) {\n\t\t\t\tsetProperty(dom, i, value, oldProps[i], namespace);\n\t\t\t}\n\t\t}\n\n\t\t// If the new vnode didn't have dangerouslySetInnerHTML, diff its children\n\t\tif (newHtml) {\n\t\t\t// Avoid re-applying the same '__html' if it did not changed between re-render\n\t\t\tif (\n\t\t\t\t!isHydrating &&\n\t\t\t\t(!oldHtml ||\n\t\t\t\t\t(newHtml.__html != oldHtml.__html && newHtml.__html != dom.innerHTML))\n\t\t\t) {\n\t\t\t\tdom.innerHTML = newHtml.__html;\n\t\t\t}\n\n\t\t\tnewVNode._children = [];\n\t\t} else {\n\t\t\tif (oldHtml) dom.innerHTML = '';\n\n\t\t\tdiffChildren(\n\t\t\t\t// @ts-expect-error\n\t\t\t\tnewVNode.type == 'template' ? dom.content : dom,\n\t\t\t\tisArray(newChildren) ? newChildren : [newChildren],\n\t\t\t\tnewVNode,\n\t\t\t\toldVNode,\n\t\t\t\tglobalContext,\n\t\t\t\tnodeType == 'foreignObject' ? XHTML_NAMESPACE : namespace,\n\t\t\t\texcessDomChildren,\n\t\t\t\tcommitQueue,\n\t\t\t\texcessDomChildren\n\t\t\t\t\t? excessDomChildren[0]\n\t\t\t\t\t: oldVNode._children && getDomSibling(oldVNode, 0),\n\t\t\t\tisHydrating,\n\t\t\t\trefQueue\n\t\t\t);\n\n\t\t\t// Remove children that are not part of any vnode.\n\t\t\tif (excessDomChildren != NULL) {\n\t\t\t\tfor (i = excessDomChildren.length; i--; ) {\n\t\t\t\t\tremoveNode(excessDomChildren[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// As above, don't diff props during hydration\n\t\tif (!isHydrating) {\n\t\t\ti = 'value';\n\t\t\tif (nodeType == 'progress' && inputValue == NULL) {\n\t\t\t\tdom.removeAttribute('value');\n\t\t\t} else if (\n\t\t\t\tinputValue != UNDEFINED &&\n\t\t\t\t// #2756 For the <progress>-element the initial value is 0,\n\t\t\t\t// despite the attribute not being present. When the attribute\n\t\t\t\t// is missing the progress bar is treated as indeterminate.\n\t\t\t\t// To fix that we'll always update it when it is 0 for progress elements\n\t\t\t\t(inputValue !== dom[i] ||\n\t\t\t\t\t(nodeType == 'progress' && !inputValue) ||\n\t\t\t\t\t// This is only for IE 11 to fix <select> value not being updated.\n\t\t\t\t\t// To avoid a stale select value we need to set the option.value\n\t\t\t\t\t// again, which triggers IE11 to re-evaluate the select value\n\t\t\t\t\t(nodeType == 'option' && inputValue != oldProps[i]))\n\t\t\t) {\n\t\t\t\tsetProperty(dom, i, inputValue, oldProps[i], namespace);\n\t\t\t}\n\n\t\t\ti = 'checked';\n\t\t\tif (checked != UNDEFINED && checked != dom[i]) {\n\t\t\t\tsetProperty(dom, i, checked, oldProps[i], namespace);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn dom;\n}\n\n/**\n * Invoke or update a ref, depending on whether it is a function or object ref.\n * @param {Ref<any> & { _unmount?: unknown }} ref\n * @param {any} value\n * @param {VNode} vnode\n */\nexport function applyRef(ref, value, vnode) {\n\ttry {\n\t\tif (typeof ref == 'function') {\n\t\t\tlet hasRefUnmount = typeof ref._unmount == 'function';\n\t\t\tif (hasRefUnmount) {\n\t\t\t\t// @ts-ignore TS doesn't like moving narrowing checks into variables\n\t\t\t\tref._unmount();\n\t\t\t}\n\n\t\t\tif (!hasRefUnmount || value != NULL) {\n\t\t\t\t// Store the cleanup function on the function\n\t\t\t\t// instance object itself to avoid shape\n\t\t\t\t// transitioning vnode\n\t\t\t\tref._unmount = ref(value);\n\t\t\t}\n\t\t} else ref.current = value;\n\t} catch (e) {\n\t\toptions._catchError(e, vnode);\n\t}\n}\n\n/**\n * Unmount a virtual node from the tree and apply DOM changes\n * @param {VNode} vnode The virtual node to unmount\n * @param {VNode} parentVNode The parent of the VNode that initiated the unmount\n * @param {boolean} [skipRemove] Flag that indicates that a parent node of the\n * current element is already detached from the DOM.\n */\nexport function unmount(vnode, parentVNode, skipRemove) {\n\tlet r;\n\tif (options.unmount) options.unmount(vnode);\n\n\tif ((r = vnode.ref)) {\n\t\tif (!r.current || r.current == vnode._dom) {\n\t\t\tapplyRef(r, NULL, parentVNode);\n\t\t}\n\t}\n\n\tif ((r = vnode._component) != NULL) {\n\t\tif (r.componentWillUnmount) {\n\t\t\ttry {\n\t\t\t\tr.componentWillUnmount();\n\t\t\t} catch (e) {\n\t\t\t\toptions._catchError(e, parentVNode);\n\t\t\t}\n\t\t}\n\n\t\tr.base = r._parentDom = NULL;\n\t}\n\n\tif ((r = vnode._children)) {\n\t\tfor (let i = 0; i < r.length; i++) {\n\t\t\tif (r[i]) {\n\t\t\t\tunmount(\n\t\t\t\t\tr[i],\n\t\t\t\t\tparentVNode,\n\t\t\t\t\tskipRemove || typeof vnode.type != 'function'\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\tif (!skipRemove) {\n\t\tremoveNode(vnode._dom);\n\t}\n\n\tvnode._component = vnode._parent = vnode._dom = UNDEFINED;\n}\n\n/** The `.render()` method for a PFC backing instance. */\nfunction doRender(props, state, context) {\n\treturn this.constructor(props, context);\n}\n","import { EMPTY_OBJ, NULL } from './constants';\nimport { commitRoot, diff } from './diff/index';\nimport { createElement, Fragment } from './create-element';\nimport options from './options';\nimport { slice } from './util';\n\n/**\n * Render a Preact virtual node into a DOM element\n * @param {import('./internal').ComponentChild} vnode The virtual node to render\n * @param {import('./internal').PreactElement} parentDom The DOM element to render into\n * @param {import('./internal').PreactElement | object} [replaceNode] Optional: Attempt to re-use an\n * existing DOM tree rooted at `replaceNode`\n */\nexport function render(vnode, parentDom, replaceNode) {\n\t// https://github.com/preactjs/preact/issues/3794\n\tif (parentDom == document) {\n\t\tparentDom = document.documentElement;\n\t}\n\n\tif (options._root) options._root(vnode, parentDom);\n\n\t// We abuse the `replaceNode` parameter in `hydrate()` to signal if we are in\n\t// hydration mode or not by passing the `hydrate` function instead of a DOM\n\t// element..\n\tlet isHydrating = typeof replaceNode == 'function';\n\n\t// To be able to support calling `render()` multiple times on the same\n\t// DOM node, we need to obtain a reference to the previous tree. We do\n\t// this by assigning a new `_children` property to DOM nodes which points\n\t// to the last rendered tree. By default this property is not present, which\n\t// means that we are mounting a new tree for the first time.\n\tlet oldVNode = isHydrating\n\t\t? NULL\n\t\t: (replaceNode && replaceNode._children) || parentDom._children;\n\n\tvnode = ((!isHydrating && replaceNode) || parentDom)._children =\n\t\tcreateElement(Fragment, NULL, [vnode]);\n\n\t// List of effects that need to be called after diffing.\n\tlet commitQueue = [],\n\t\trefQueue = [];\n\tdiff(\n\t\tparentDom,\n\t\t// Determine the new vnode tree and store it on the DOM element on\n\t\t// our custom `_children` property.\n\t\tvnode,\n\t\toldVNode || EMPTY_OBJ,\n\t\tEMPTY_OBJ,\n\t\tparentDom.namespaceURI,\n\t\t!isHydrating && replaceNode\n\t\t\t? [replaceNode]\n\t\t\t: oldVNode\n\t\t\t\t? NULL\n\t\t\t\t: parentDom.firstChild\n\t\t\t\t\t? slice.call(parentDom.childNodes)\n\t\t\t\t\t: NULL,\n\t\tcommitQueue,\n\t\t!isHydrating && replaceNode\n\t\t\t? replaceNode\n\t\t\t: oldVNode\n\t\t\t\t? oldVNode._dom\n\t\t\t\t: parentDom.firstChild,\n\t\tisHydrating,\n\t\trefQueue\n\t);\n\n\t// Flush all queued effects\n\tcommitRoot(commitQueue, vnode, refQueue);\n}\n\n/**\n * Update an existing DOM element with data from a Preact virtual node\n * @param {import('./internal').ComponentChild} vnode The virtual node to render\n * @param {import('./internal').PreactElement} parentDom The DOM element to update\n */\nexport function hydrate(vnode, parentDom) {\n\trender(vnode, parentDom, hydrate);\n}\n","import { NULL } from '../constants';\n\n/**\n * Find the closest error boundary to a thrown error and call it\n * @param {object} error The thrown value\n * @param {import('../internal').VNode} vnode The vnode that threw the error that was caught (except\n * for unmounting when this parameter is the highest parent that was being\n * unmounted)\n * @param {import('../internal').VNode} [oldVNode]\n * @param {import('../internal').ErrorInfo} [errorInfo]\n */\nexport function _catchError(error, vnode, oldVNode, errorInfo) {\n\t/** @type {import('../internal').Component} */\n\tlet component,\n\t\t/** @type {import('../internal').ComponentType} */\n\t\tctor,\n\t\t/** @type {boolean} */\n\t\thandled;\n\n\tfor (; (vnode = vnode._parent); ) {\n\t\tif ((component = vnode._component) && !component._processingException) {\n\t\t\ttry {\n\t\t\t\tctor = component.constructor;\n\n\t\t\t\tif (ctor && ctor.getDerivedStateFromError != NULL) {\n\t\t\t\t\tcomponent.setState(ctor.getDerivedStateFromError(error));\n\t\t\t\t\thandled = component._dirty;\n\t\t\t\t}\n\n\t\t\t\tif (component.componentDidCatch != NULL) {\n\t\t\t\t\tcomponent.componentDidCatch(error, errorInfo || {});\n\t\t\t\t\thandled = component._dirty;\n\t\t\t\t}\n\n\t\t\t\t// This is an error boundary. Mark it as having bailed out, and whether it was mid-hydration.\n\t\t\t\tif (handled) {\n\t\t\t\t\treturn (component._pendingError = component);\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\terror = e;\n\t\t\t}\n\t\t}\n\t}\n\n\tthrow error;\n}\n","import { options as _options } from 'preact';\n\n/** @type {number} */\nlet currentIndex;\n\n/** @type {import('./internal').Component} */\nlet currentComponent;\n\n/** @type {import('./internal').Component} */\nlet previousComponent;\n\n/** @type {number} */\nlet currentHook = 0;\n\n/** @type {Array<import('./internal').Component>} */\nlet afterPaintEffects = [];\n\n// Cast to use internal Options type\nconst options = /** @type {import('./internal').Options} */ (_options);\n\nlet oldBeforeDiff = options._diff;\nlet oldBeforeRender = options._render;\nlet oldAfterDiff = options.diffed;\nlet oldCommit = options._commit;\nlet oldBeforeUnmount = options.unmount;\nlet oldRoot = options._root;\n\n// We take the minimum timeout for requestAnimationFrame to ensure that\n// the callback is invoked after the next frame. 35ms is based on a 30hz\n// refresh rate, which is the minimum rate for a smooth user experience.\nconst RAF_TIMEOUT = 35;\nlet prevRaf;\n\n/** @type {(vnode: import('./internal').VNode) => void} */\noptions._diff = vnode => {\n\tcurrentComponent = null;\n\tif (oldBeforeDiff) oldBeforeDiff(vnode);\n};\n\noptions._root = (vnode, parentDom) => {\n\tif (vnode && parentDom._children && parentDom._children._mask) {\n\t\tvnode._mask = parentDom._children._mask;\n\t}\n\n\tif (oldRoot) oldRoot(vnode, parentDom);\n};\n\n/** @type {(vnode: import('./internal').VNode) => void} */\noptions._render = vnode => {\n\tif (oldBeforeRender) oldBeforeRender(vnode);\n\n\tcurrentComponent = vnode._component;\n\tcurrentIndex = 0;\n\n\tconst hooks = currentComponent.__hooks;\n\tif (hooks) {\n\t\tif (previousComponent === currentComponent) {\n\t\t\thooks._pendingEffects = [];\n\t\t\tcurrentComponent._renderCallbacks = [];\n\t\t\thooks._list.forEach(hookItem => {\n\t\t\t\tif (hookItem._nextValue) {\n\t\t\t\t\thookItem._value = hookItem._nextValue;\n\t\t\t\t}\n\t\t\t\thookItem._pendingArgs = hookItem._nextValue = undefined;\n\t\t\t});\n\t\t} else {\n\t\t\thooks._pendingEffects.forEach(invokeCleanup);\n\t\t\thooks._pendingEffects.forEach(invokeEffect);\n\t\t\thooks._pendingEffects = [];\n\t\t\tcurrentIndex = 0;\n\t\t}\n\t}\n\tpreviousComponent = currentComponent;\n};\n\n/** @type {(vnode: import('./internal').VNode) => void} */\noptions.diffed = vnode => {\n\tif (oldAfterDiff) oldAfterDiff(vnode);\n\n\tconst c = vnode._component;\n\tif (c && c.__hooks) {\n\t\tif (c.__hooks._pendingEffects.length) afterPaint(afterPaintEffects.push(c));\n\t\tc.__hooks._list.forEach(hookItem => {\n\t\t\tif (hookItem._pendingArgs) {\n\t\t\t\thookItem._args = hookItem._pendingArgs;\n\t\t\t}\n\t\t\thookItem._pendingArgs = undefined;\n\t\t});\n\t}\n\tpreviousComponent = currentComponent = null;\n};\n\n// TODO: Improve typing of commitQueue parameter\n/** @type {(vnode: import('./internal').VNode, commitQueue: any) => void} */\noptions._commit = (vnode, commitQueue) => {\n\tcommitQueue.some(component => {\n\t\ttry {\n\t\t\tcomponent._renderCallbacks.forEach(invokeCleanup);\n\t\t\tcomponent._renderCallbacks = component._renderCallbacks.filter(cb =>\n\t\t\t\tcb._value ? invokeEffect(cb) : true\n\t\t\t);\n\t\t} catch (e) {\n\t\t\tcommitQueue.some(c => {\n\t\t\t\tif (c._renderCallbacks) c._renderCallbacks = [];\n\t\t\t});\n\t\t\tcommitQueue = [];\n\t\t\toptions._catchError(e, component._vnode);\n\t\t}\n\t});\n\n\tif (oldCommit) oldCommit(vnode, commitQueue);\n};\n\n/** @type {(vnode: import('./internal').VNode) => void} */\noptions.unmount = vnode => {\n\tif (oldBeforeUnmount) oldBeforeUnmount(vnode);\n\n\tconst c = vnode._component;\n\tif (c && c.__hooks) {\n\t\tlet hasErrored;\n\t\tc.__hooks._list.forEach(s => {\n\t\t\ttry {\n\t\t\t\tinvokeCleanup(s);\n\t\t\t} catch (e) {\n\t\t\t\thasErrored = e;\n\t\t\t}\n\t\t});\n\t\tc.__hooks = undefined;\n\t\tif (hasErrored) options._catchError(hasErrored, c._vnode);\n\t}\n};\n\n/**\n * Get a hook's state from the currentComponent\n * @param {number} index The index of the hook to get\n * @param {number} type The index of the hook to get\n * @returns {any}\n */\nfunction getHookState(index, type) {\n\tif (options._hook) {\n\t\toptions._hook(currentComponent, index, currentHook || type);\n\t}\n\tcurrentHook = 0;\n\n\t// Largely inspired by:\n\t// * https://github.com/michael-klein/funcy.js/blob/f6be73468e6ec46b0ff5aa3cc4c9baf72a29025a/src/hooks/core_hooks.mjs\n\t// * https://github.com/michael-klein/funcy.js/blob/650beaa58c43c33a74820a3c98b3c7079cf2e333/src/renderer.mjs\n\t// Other implementations to look at:\n\t// * https://codesandbox.io/s/mnox05qp8\n\tconst hooks =\n\t\tcurrentComponent.__hooks ||\n\t\t(currentComponent.__hooks = {\n\t\t\t_list: [],\n\t\t\t_pendingEffects: []\n\t\t});\n\n\tif (index >= hooks._list.length) {\n\t\thooks._list.push({});\n\t}\n\n\treturn hooks._list[index];\n}\n\n/**\n * @template {unknown} S\n * @param {import('./index').Dispatch<import('./index').StateUpdater<S>>} [initialState]\n * @returns {[S, (state: S) => void]}\n */\nexport function useState(initialState) {\n\tcurrentHook = 1;\n\treturn useReducer(invokeOrReturn, initialState);\n}\n\n/**\n * @template {unknown} S\n * @template {unknown} A\n * @param {import('./index').Reducer<S, A>} reducer\n * @param {import('./index').Dispatch<import('./index').StateUpdater<S>>} initialState\n * @param {(initialState: any) => void} [init]\n * @returns {[ S, (state: S) => void ]}\n */\nexport function useReducer(reducer, initialState, init) {\n\t/** @type {import('./internal').ReducerHookState} */\n\tconst hookState = getHookState(currentIndex++, 2);\n\thookState._reducer = reducer;\n\tif (!hookState._component) {\n\t\thookState._value = [\n\t\t\t!init ? invokeOrReturn(undefined, initialState) : init(initialState),\n\n\t\t\taction => {\n\t\t\t\tconst currentValue = hookState._nextValue\n\t\t\t\t\t? hookState._nextValue[0]\n\t\t\t\t\t: hookState._value[0];\n\t\t\t\tconst nextValue = hookState._reducer(currentValue, action);\n\n\t\t\t\tif (currentValue !== nextValue) {\n\t\t\t\t\thookState._nextValue = [nextValue, hookState._value[1]];\n\t\t\t\t\thookState._component.setState({});\n\t\t\t\t}\n\t\t\t}\n\t\t];\n\n\t\thookState._component = currentComponent;\n\n\t\tif (!currentComponent._hasScuFromHooks) {\n\t\t\tcurrentComponent._hasScuFromHooks = true;\n\t\t\tlet prevScu = currentComponent.shouldComponentUpdate;\n\t\t\tconst prevCWU = currentComponent.componentWillUpdate;\n\n\t\t\t// If we're dealing with a forced update `shouldComponentUpdate` will\n\t\t\t// not be called. But we use that to update the hook values, so we\n\t\t\t// need to call it.\n\t\t\tcurrentComponent.componentWillUpdate = function (p, s, c) {\n\t\t\t\tif (this._force) {\n\t\t\t\t\tlet tmp = prevScu;\n\t\t\t\t\t// Clear to avoid other sCU hooks from being called\n\t\t\t\t\tprevScu = undefined;\n\t\t\t\t\tupdateHookState(p, s, c);\n\t\t\t\t\tprevScu = tmp;\n\t\t\t\t}\n\n\t\t\t\tif (prevCWU) prevCWU.call(this, p, s, c);\n\t\t\t};\n\n\t\t\t// This SCU has the purpose of bailing out after repeated updates\n\t\t\t// to stateful hooks.\n\t\t\t// we store the next value in _nextValue[0] and keep doing that for all\n\t\t\t// state setters, if we have next states and\n\t\t\t// all next states within a component end up being equal to their original state\n\t\t\t// we are safe to bail out for this specific component.\n\t\t\t/**\n\t\t\t *\n\t\t\t * @type {import('./internal').Component[\"shouldComponentUpdate\"]}\n\t\t\t */\n\t\t\t// @ts-ignore - We don't use TS to downtranspile\n\t\t\t// eslint-disable-next-line no-inner-declarations\n\t\t\tfunction updateHookState(p, s, c) {\n\t\t\t\tif (!hookState._component.__hooks) return true;\n\n\t\t\t\t/** @type {(x: import('./internal').HookState) => x is import('./internal').ReducerHookState} */\n\t\t\t\tconst isStateHook = x => !!x._component;\n\t\t\t\tconst stateHooks =\n\t\t\t\t\thookState._component.__hooks._list.filter(isStateHook);\n\n\t\t\t\tconst allHooksEmpty = stateHooks.every(x => !x._nextValue);\n\t\t\t\t// When we have no updated hooks in the component we invoke the previous SCU or\n\t\t\t\t// traverse the VDOM tree further.\n\t\t\t\tif (allHooksEmpty) {\n\t\t\t\t\treturn prevScu ? prevScu.call(this, p, s, c) : true;\n\t\t\t\t}\n\n\t\t\t\t// We check whether we have components with a nextValue set that\n\t\t\t\t// have values that aren't equal to one another this pushes\n\t\t\t\t// us to update further down the tree\n\t\t\t\tlet shouldUpdate = hookState._component.props !== p;\n\t\t\t\tstateHooks.forEach(hookItem => {\n\t\t\t\t\tif (hookItem._nextValue) {\n\t\t\t\t\t\tconst currentValue = hookItem._value[0];\n\t\t\t\t\t\thookItem._value = hookItem._nextValue;\n\t\t\t\t\t\thookItem._nextValue = undefined;\n\t\t\t\t\t\tif (currentValue !== hookItem._value[0]) shouldUpdate = true;\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\treturn prevScu\n\t\t\t\t\t? prevScu.call(this, p, s, c) || shouldUpdate\n\t\t\t\t\t: shouldUpdate;\n\t\t\t}\n\n\t\t\tcurrentComponent.shouldComponentUpdate = updateHookState;\n\t\t}\n\t}\n\n\treturn hookState._nextValue || hookState._value;\n}\n\n/**\n * @param {import('./internal').Effect} callback\n * @param {unknown[]} args\n * @returns {void}\n */\nexport function useEffect(callback, args) {\n\t/** @type {import('./internal').EffectHookState} */\n\tconst state = getHookState(currentIndex++, 3);\n\tif (!options._skipEffects && argsChanged(state._args, args)) {\n\t\tstate._value = callback;\n\t\tstate._pendingArgs = args;\n\n\t\tcurrentComponent.__hooks._pendingEffects.push(state);\n\t}\n}\n\n/**\n * @param {import('./internal').Effect} callback\n * @param {unknown[]} args\n * @returns {void}\n */\nexport function useLayoutEffect(callback, args) {\n\t/** @type {import('./internal').EffectHookState} */\n\tconst state = getHookState(currentIndex++, 4);\n\tif (!options._skipEffects && argsChanged(state._args, args)) {\n\t\tstate._value = callback;\n\t\tstate._pendingArgs = args;\n\n\t\tcurrentComponent._renderCallbacks.push(state);\n\t}\n}\n\n/** @type {(initialValue: unknown) => unknown} */\nexport function useRef(initialValue) {\n\tcurrentHook = 5;\n\treturn useMemo(() => ({ current: initialValue }), []);\n}\n\n/**\n * @param {object} ref\n * @param {() => object} createHandle\n * @param {unknown[]} args\n * @returns {void}\n */\nexport function useImperativeHandle(ref, createHandle, args) {\n\tcurrentHook = 6;\n\tuseLayoutEffect(\n\t\t() => {\n\t\t\tif (typeof ref == 'function') {\n\t\t\t\tconst result = ref(createHandle());\n\t\t\t\treturn () => {\n\t\t\t\t\tref(null);\n\t\t\t\t\tif (result && typeof result == 'function') result();\n\t\t\t\t};\n\t\t\t} else if (ref) {\n\t\t\t\tref.current = createHandle();\n\t\t\t\treturn () => (ref.current = null);\n\t\t\t}\n\t\t},\n\t\targs == null ? args : args.concat(ref)\n\t);\n}\n\n/**\n * @template {unknown} T\n * @param {() => T} factory\n * @param {unknown[]} args\n * @returns {T}\n */\nexport function useMemo(factory, args) {\n\t/** @type {import('./internal').MemoHookState<T>} */\n\tconst state = getHookState(currentIndex++, 7);\n\tif (argsChanged(state._args, args)) {\n\t\tstate._value = factory();\n\t\tstate._args = args;\n\t\tstate._factory = factory;\n\t}\n\n\treturn state._value;\n}\n\n/**\n * @param {() => void} callback\n * @param {unknown[]} args\n * @returns {() => void}\n */\nexport function useCallback(callback, args) {\n\tcurrentHook = 8;\n\treturn useMemo(() => callback, args);\n}\n\n/**\n * @param {import('./internal').PreactContext} context\n */\nexport function useContext(context) {\n\tconst provider = currentComponent.context[context._id];\n\t// We could skip this call here, but than we'd not call\n\t// `options._hook`. We need to do that in order to make\n\t// the devtools aware of this hook.\n\t/** @type {import('./internal').ContextHookState} */\n\tconst state = getHookState(currentIndex++, 9);\n\t// The devtools needs access to the context object to\n\t// be able to pull of the default value when no provider\n\t// is present in the tree.\n\tstate._context = context;\n\tif (!provider) return context._defaultValue;\n\t// This is probably not safe to convert to \"!\"\n\tif (state._value == null) {\n\t\tstate._value = true;\n\t\tprovider.sub(currentComponent);\n\t}\n\treturn provider.props.value;\n}\n\n/**\n * Display a custom label for a custom hook for the devtools panel\n * @type {<T>(value: T, cb?: (value: T) => string | number) => void}\n */\nexport function useDebugValue(value, formatter) {\n\tif (options.useDebugValue) {\n\t\toptions.useDebugValue(\n\t\t\tformatter ? formatter(value) : /** @type {any}*/ (value)\n\t\t);\n\t}\n}\n\n/**\n * @param {(error: unknown, errorInfo: import('preact').ErrorInfo) => void} cb\n * @returns {[unknown, () => void]}\n */\nexport function useErrorBoundary(cb) {\n\t/** @type {import('./internal').ErrorBoundaryHookState} */\n\tconst state = getHookState(currentIndex++, 10);\n\tconst errState = useState();\n\tstate._value = cb;\n\tif (!currentComponent.componentDidCatch) {\n\t\tcurrentComponent.componentDidCatch = (err, errorInfo) => {\n\t\t\tif (state._value) state._value(err, errorInfo);\n\t\t\terrState[1](err);\n\t\t};\n\t}\n\treturn [\n\t\terrState[0],\n\t\t() => {\n\t\t\terrState[1](undefined);\n\t\t}\n\t];\n}\n\n/** @type {() => string} */\nexport function useId() {\n\t/** @type {import('./internal').IdHookState} */\n\tconst state = getHookState(currentIndex++, 11);\n\tif (!state._value) {\n\t\t// Grab either the root node or the nearest async boundary node.\n\t\t/** @type {import('./internal').VNode} */\n\t\tlet root = currentComponent._vnode;\n\t\twhile (root !== null && !root._mask && root._parent !== null) {\n\t\t\troot = root._parent;\n\t\t}\n\n\t\tlet mask = root._mask || (root._mask = [0, 0]);\n\t\tstate._value = 'P' + mask[0] + '-' + mask[1]++;\n\t}\n\n\treturn state._value;\n}\n\n/**\n * After paint effects consumer.\n */\nfunction flushAfterPaintEffects() {\n\tlet component;\n\twhile ((component = afterPaintEffects.shift())) {\n\t\tif (!component._parentDom || !component.__hooks) continue;\n\t\ttry {\n\t\t\tcomponent.__hooks._pendingEffects.forEach(invokeCleanup);\n\t\t\tcomponent.__hooks._pendingEffects.forEach(invokeEffect);\n\t\t\tcomponent.__hooks._pendingEffects = [];\n\t\t} catch (e) {\n\t\t\tcomponent.__hooks._pendingEffects = [];\n\t\t\toptions._catchError(e, component._vnode);\n\t\t}\n\t}\n}\n\nlet HAS_RAF = typeof requestAnimationFrame == 'function';\n\n/**\n * Schedule a callback to be invoked after the browser has a chance to paint a new frame.\n * Do this by combining requestAnimationFrame (rAF) + setTimeout to invoke a callback after\n * the next browser frame.\n *\n * Also, schedule a timeout in parallel to the the rAF to ensure the callback is invoked\n * even if RAF doesn't fire (for example if the browser tab is not visible)\n *\n * @param {() => void} callback\n */\nfunction afterNextFrame(callback) {\n\tconst done = () => {\n\t\tclearTimeout(timeout);\n\t\tif (HAS_RAF) cancelAnimationFrame(raf);\n\t\tsetTimeout(callback);\n\t};\n\tconst timeout = setTimeout(done, RAF_TIMEOUT);\n\n\tlet raf;\n\tif (HAS_RAF) {\n\t\traf = requestAnimationFrame(done);\n\t}\n}\n\n// Note: if someone used options.debounceRendering = requestAnimationFrame,\n// then effects will ALWAYS run on the NEXT frame instead of the current one, incurring a ~16ms delay.\n// Perhaps this is not such a big deal.\n/**\n * Schedule afterPaintEffects flush after the browser paints\n * @param {number} newQueueLength\n * @returns {void}\n */\nfunction afterPaint(newQueueLength) {\n\tif (newQueueLength === 1 || prevRaf !== options.requestAnimationFrame) {\n\t\tprevRaf = options.requestAnimationFrame;\n\t\t(prevRaf || afterNextFrame)(flushAfterPaintEffects);\n\t}\n}\n\n/**\n * @param {import('./internal').HookState} hook\n * @returns {void}\n */\nfunction invokeCleanup(hook) {\n\t// A hook cleanup can introduce a call to render which creates a new root, this will call options.vnode\n\t// and move the currentComponent away.\n\tconst comp = currentComponent;\n\tlet cleanup = hook._cleanup;\n\tif (typeof cleanup == 'function') {\n\t\thook._cleanup = undefined;\n\t\tcleanup();\n\t}\n\n\tcurrentComponent = comp;\n}\n\n/**\n * Invoke a Hook's effect\n * @param {import('./internal').EffectHookState} hook\n * @returns {void}\n */\nfunction invokeEffect(hook) {\n\t// A hook call can introduce a call to render which creates a new root, this will call options.vnode\n\t// and move the currentComponent away.\n\tconst comp = currentComponent;\n\thook._cleanup = hook._value();\n\tcurrentComponent = comp;\n}\n\n/**\n * @param {unknown[]} oldArgs\n * @param {unknown[]} newArgs\n * @returns {boolean}\n */\nfunction argsChanged(oldArgs, newArgs) {\n\treturn (\n\t\t!oldArgs ||\n\t\toldArgs.length !== newArgs.length ||\n\t\tnewArgs.some((arg, index) => arg !== oldArgs[index])\n\t);\n}\n\n/**\n * @template Arg\n * @param {Arg} arg\n * @param {(arg: Arg) => any} f\n * @returns {any}\n */\nfunction invokeOrReturn(arg, f) {\n\treturn typeof f == 'function' ? f(arg) : f;\n}\n","/**\n * Assign properties from `props` to `obj`\n * @template O, P The obj and props types\n * @param {O} obj The object to copy properties to\n * @param {P} props The object to copy properties from\n * @returns {O & P}\n */\nexport function assign(obj, props) {\n\tfor (let i in props) obj[i] = props[i];\n\treturn /** @type {O & P} */ (obj);\n}\n\n/**\n * Check if two objects have a different shape\n * @param {object} a\n * @param {object} b\n * @returns {boolean}\n */\nexport function shallowDiffers(a, b) {\n\tfor (let i in a) if (i !== '__source' && !(i in b)) return true;\n\tfor (let i in b) if (i !== '__source' && a[i] !== b[i]) return true;\n\treturn false;\n}\n\n/**\n * Check if two values are the same value\n * @param {*} x\n * @param {*} y\n * @returns {boolean}\n */\nexport function is(x, y) {\n\treturn (x === y && (x !== 0 || 1 / x === 1 / y)) || (x !== x && y !== y);\n}\n","import { useState, useLayoutEffect, useEffect } from 'preact/hooks';\nimport { is } from './util';\n\n/**\n * This is taken from https://github.com/facebook/react/blob/main/packages/use-sync-external-store/src/useSyncExternalStoreShimClient.js#L84\n * on a high level this cuts out the warnings, ... and attempts a smaller implementation\n * @typedef {{ _value: any; _getSnapshot: () => any }} Store\n */\nexport function useSyncExternalStore(subscribe, getSnapshot) {\n\tconst value = getSnapshot();\n\n\t/**\n\t * @typedef {{ _instance: Store }} StoreRef\n\t * @type {[StoreRef, (store: StoreRef) => void]}\n\t */\n\tconst [{ _instance }, forceUpdate] = useState({\n\t\t_instance: { _value: value, _getSnapshot: getSnapshot }\n\t});\n\n\tuseLayoutEffect(() => {\n\t\t_instance._value = value;\n\t\t_instance._getSnapshot = getSnapshot;\n\n\t\tif (didSnapshotChange(_instance)) {\n\t\t\tforceUpdate({ _instance });\n\t\t}\n\t}, [subscribe, value, getSnapshot]);\n\n\tuseEffect(() => {\n\t\tif (didSnapshotChange(_instance)) {\n\t\t\tforceUpdate({ _instance });\n\t\t}\n\n\t\treturn subscribe(() => {\n\t\t\tif (didSnapshotChange(_instance)) {\n\t\t\t\tforceUpdate({ _instance });\n\t\t\t}\n\t\t});\n\t}, [subscribe]);\n\n\treturn value;\n}\n\n/** @type {(inst: Store) => boolean} */\nfunction didSnapshotChange(inst) {\n\tconst latestGetSnapshot = inst._getSnapshot;\n\tconst prevValue = inst._value;\n\ttry {\n\t\tconst nextValue = latestGetSnapshot();\n\t\treturn !is(prevValue, nextValue);\n\t} catch (error) {\n\t\treturn true;\n\t}\n}\n\nexport function startTransition(cb) {\n\tcb();\n}\n\nexport function useDeferredValue(val) {\n\treturn val;\n}\n\nexport function useTransition() {\n\treturn [false, startTransition];\n}\n\n// TODO: in theory this should be done after a VNode is diffed as we want to insert\n// styles/... before it attaches\nexport const useInsertionEffect = useLayoutEffect;\n","import { Component } from 'preact';\nimport { shallowDiffers } from './util';\n\n/**\n * Component class with a predefined `shouldComponentUpdate` implementation\n */\nexport function PureComponent(p, c) {\n\tthis.props = p;\n\tthis.context = c;\n}\nPureComponent.prototype = new Component();\n// Some third-party libraries check if this property is present\nPureComponent.prototype.isPureReactComponent = true;\nPureComponent.prototype.shouldComponentUpdate = function (props, state) {\n\treturn shallowDiffers(this.props, props) || shallowDiffers(this.state, state);\n};\n","import { createElement } from 'preact';\nimport { shallowDiffers } from './util';\n\n/**\n * Memoize a component, so that it only updates when the props actually have\n * changed. This was previously known as `React.pure`.\n * @param {import('./internal').FunctionComponent} c functional component\n * @param {(prev: object, next: object) => boolean} [comparer] Custom equality function\n * @returns {import('./internal').FunctionComponent}\n */\nexport function memo(c, comparer) {\n\tfunction shouldUpdate(nextProps) {\n\t\tlet ref = this.props.ref;\n\t\tlet updateRef = ref == nextProps.ref;\n\t\tif (!updateRef && ref) {\n\t\t\tref.call ? ref(null) : (ref.current = null);\n\t\t}\n\n\t\tif (!comparer) {\n\t\t\treturn shallowDiffers(this.props, nextProps);\n\t\t}\n\n\t\treturn !comparer(this.props, nextProps) || !updateRef;\n\t}\n\n\tfunction Memoed(props) {\n\t\tthis.shouldComponentUpdate = shouldUpdate;\n\t\treturn createElement(c, props);\n\t}\n\tMemoed.displayName = 'Memo(' + (c.displayName || c.name) + ')';\n\tMemoed.prototype.isReactComponent = true;\n\tMemoed._forwarded = true;\n\tMemoed.type = c;\n\treturn Memoed;\n}\n","import { options } from 'preact';\nimport { assign } from './util';\n\nlet oldDiffHook = options._diff;\noptions._diff = vnode => {\n\tif (vnode.type && vnode.type._forwarded && vnode.ref) {\n\t\tvnode.props.ref = vnode.ref;\n\t\tvnode.ref = null;\n\t}\n\tif (oldDiffHook) oldDiffHook(vnode);\n};\n\nexport const REACT_FORWARD_SYMBOL =\n\t(typeof Symbol != 'undefined' &&\n\t\tSymbol.for &&\n\t\tSymbol.for('react.forward_ref')) ||\n\t0xf47;\n\n/**\n * Pass ref down to a child. This is mainly used in libraries with HOCs that\n * wrap components. Using `forwardRef` there is an easy way to get a reference\n * of the wrapped component instead of one of the wrapper itself.\n * @param {import('./index').ForwardFn} fn\n * @returns {import('./internal').FunctionComponent}\n */\nexport function forwardRef(fn) {\n\tfunction Forwarded(props) {\n\t\tlet clone = assign({}, props);\n\t\tdelete clone.ref;\n\t\treturn fn(clone, props.ref || null);\n\t}\n\n\t// mobx-react checks for this being present\n\tForwarded.$$typeof = REACT_FORWARD_SYMBOL;\n\t// mobx-react heavily relies on implementation details.\n\t// It expects an object here with a `render` property,\n\t// and prototype.render will fail. Without this\n\t// mobx-react throws.\n\tForwarded.render = fn;\n\n\tForwarded.prototype.isReactComponent = Forwarded._forwarded = true;\n\tForwarded.displayName = 'ForwardRef(' + (fn.displayName || fn.name) + ')';\n\treturn Forwarded;\n}\n","import { toChildArray } from 'preact';\n\nconst mapFn = (children, fn) => {\n\tif (children == null) return null;\n\treturn toChildArray(toChildArray(children).map(fn));\n};\n\n// This API is completely unnecessary for Preact, so it's basically passthrough.\nexport const Children = {\n\tmap: mapFn,\n\tforEach: mapFn,\n\tcount(children) {\n\t\treturn children ? toChildArray(children).length : 0;\n\t},\n\tonly(children) {\n\t\tconst normalized = toChildArray(children);\n\t\tif (normalized.length !== 1) throw 'Children.only';\n\t\treturn normalized[0];\n\t},\n\ttoArray: toChildArray\n};\n","import { Component, createElement, options, Fragment } from 'preact';\nimport { MODE_HYDRATE } from '../../src/constants';\nimport { assign } from './util';\n\nconst oldCatchError = options._catchError;\noptions._catchError = function (error, newVNode, oldVNode, errorInfo) {\n\tif (error.then) {\n\t\t/** @type {import('./internal').Component} */\n\t\tlet component;\n\t\tlet vnode = newVNode;\n\n\t\tfor (; (vnode = vnode._parent); ) {\n\t\t\tif ((component = vnode._component) && component._childDidSuspend) {\n\t\t\t\tif (newVNode._dom == null) {\n\t\t\t\t\tnewVNode._dom = oldVNode._dom;\n\t\t\t\t\tnewVNode._children = oldVNode._children;\n\t\t\t\t}\n\t\t\t\t// Don't call oldCatchError if we found a Suspense\n\t\t\t\treturn component._childDidSuspend(error, newVNode);\n\t\t\t}\n\t\t}\n\t}\n\toldCatchError(error, newVNode, oldVNode, errorInfo);\n};\n\nconst oldUnmount = options.unmount;\noptions.unmount = function (vnode) {\n\t/** @type {import('./internal').Component} */\n\tconst component = vnode._component;\n\tif (component) component._unmounted = true;\n\tif (component && component._onResolve) {\n\t\tcomponent._onResolve();\n\t}\n\n\t// if the component is still hydrating\n\t// most likely it is because the component is suspended\n\t// we set the vnode.type as `null` so that it is not a typeof function\n\t// so the unmount will remove the vnode._dom\n\tif (component && vnode._flags & MODE_HYDRATE) {\n\t\tvnode.type = null;\n\t}\n\n\tif (oldUnmount) oldUnmount(vnode);\n};\n\nfunction detachedClone(vnode, detachedParent, parentDom) {\n\tif (vnode) {\n\t\tif (vnode._component && vnode._component.__hooks) {\n\t\t\tvnode._component.__hooks._list.forEach(effect => {\n\t\t\t\tif (typeof effect._cleanup == 'function') effect._cleanup();\n\t\t\t});\n\n\t\t\tvnode._component.__hooks = null;\n\t\t}\n\n\t\tvnode = assign({}, vnode);\n\t\tif (vnode._component != null) {\n\t\t\tif (vnode._component._parentDom === parentDom) {\n\t\t\t\tvnode._component._parentDom = detachedParent;\n\t\t\t}\n\n\t\t\tvnode._component._force = true;\n\n\t\t\tvnode._component = null;\n\t\t}\n\n\t\tvnode._children =\n\t\t\tvnode._children &&\n\t\t\tvnode._children.map(child =>\n\t\t\t\tdetachedClone(child, detachedParent, parentDom)\n\t\t\t);\n\t}\n\n\treturn vnode;\n}\n\nfunction removeOriginal(vnode, detachedParent, originalParent) {\n\tif (vnode && originalParent) {\n\t\tvnode._original = null;\n\t\tvnode._children =\n\t\t\tvnode._children &&\n\t\t\tvnode._children.map(child =>\n\t\t\t\tremoveOriginal(child, detachedParent, originalParent)\n\t\t\t);\n\n\t\tif (vnode._component) {\n\t\t\tif (vnode._component._parentDom === detachedParent) {\n\t\t\t\tif (vnode._dom) {\n\t\t\t\t\toriginalParent.appendChild(vnode._dom);\n\t\t\t\t}\n\t\t\t\tvnode._component._force = true;\n\t\t\t\tvnode._component._parentDom = originalParent;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn vnode;\n}\n\n// having custom inheritance instead of a class here saves a lot of bytes\nexport function Suspense() {\n\t// we do not call super here to golf some bytes...\n\tthis._pendingSuspensionCount = 0;\n\tthis._suspenders = null;\n\tthis._detachOnNextRender = null;\n}\n\n// Things we do here to save some bytes but are not proper JS inheritance:\n// - call `new Component()` as the prototype\n// - do not set `Suspense.prototype.constructor` to `Suspense`\nSuspense.prototype = new Component();\n\n/**\n * @this {import('./internal').SuspenseComponent}\n * @param {Promise} promise The thrown promise\n * @param {import('./internal').VNode<any, any>} suspendingVNode The suspending component\n */\nSuspense.prototype._childDidSuspend = function (promise, suspendingVNode) {\n\tconst suspendingComponent = suspendingVNode._component;\n\n\t/** @type {import('./internal').SuspenseComponent} */\n\tconst c = this;\n\n\tif (c._suspenders == null) {\n\t\tc._suspenders = [];\n\t}\n\tc._suspenders.push(suspendingComponent);\n\n\tconst resolve = suspended(c._vnode);\n\n\tlet resolved = false;\n\tconst onResolved = () => {\n\t\tif (resolved || c._unmounted) return;\n\n\t\tresolved = true;\n\t\tsuspendingComponent._onResolve = null;\n\n\t\tif (resolve) {\n\t\t\tresolve(onSuspensionComplete);\n\t\t} else {\n\t\t\tonSuspensionComplete();\n\t\t}\n\t};\n\n\tsuspendingComponent._onResolve = onResolved;\n\n\t// Store and null _parentDom to prevent setState/forceUpdate from\n\t// scheduling renders while suspended. Render would be a no-op anyway\n\t// since renderComponent checks _parentDom, but this avoids queue churn.\n\tconst originalParentDom = suspendingComponent._parentDom;\n\tsuspendingComponent._parentDom = null;\n\n\tconst onSuspensionComplete = () => {\n\t\tif (!--c._pendingSuspensionCount) {\n\t\t\t// If the suspension was during hydration we don't need to restore the\n\t\t\t// suspended children into the _children array\n\t\t\tif (c.state._suspended) {\n\t\t\t\tconst suspendedVNode = c.state._suspended;\n\t\t\t\tc._vnode._children[0] = removeOriginal(\n\t\t\t\t\tsuspendedVNode,\n\t\t\t\t\tsuspendedVNode._component._parentDom,\n\t\t\t\t\tsuspendedVNode._component._originalParentDom\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tc.setState({ _suspended: (c._detachOnNextRender = null) });\n\n\t\t\tlet suspended;\n\t\t\twhile ((suspended = c._suspenders.pop())) {\n\t\t\t\t// Restore _parentDom before forceUpdate so render can proceed\n\t\t\t\tsuspended._parentDom = originalParentDom;\n\t\t\t\tsuspended.forceUpdate();\n\t\t\t}\n\t\t}\n\t};\n\n\t/**\n\t * We do not set `suspended: true` during hydration because we want the actual markup\n\t * to remain on screen and hydrate it when the suspense actually gets resolved.\n\t * While in non-hydration cases the usual fallback -> component flow would occour.\n\t */\n\tif (\n\t\t!c._pendingSuspensionCount++ &&\n\t\t!(suspendingVNode._flags & MODE_HYDRATE)\n\t) {\n\t\tc.setState({ _suspended: (c._detachOnNextRender = c._vnode._children[0]) });\n\t}\n\tpromise.then(onResolved, onResolved);\n};\n\nSuspense.prototype.componentWillUnmount = function () {\n\tthis._suspenders = [];\n};\n\n/**\n * @this {import('./internal').SuspenseComponent}\n * @param {import('./internal').SuspenseComponent[\"props\"]} props\n * @param {import('./internal').SuspenseState} state\n */\nSuspense.prototype.render = function (props, state) {\n\tif (this._detachOnNextRender) {\n\t\t// When the Suspense's _vnode was created by a call to createVNode\n\t\t// (i.e. due to a setState further up in the tree)\n\t\t// it's _children prop is null, in this case we \"forget\" about the parked vnodes to detach\n\t\tif (this._vnode._children) {\n\t\t\tconst detachedParent = document.createElement('div');\n\t\t\tconst detachedComponent = this._vnode._children[0]._component;\n\t\t\tthis._vnode._children[0] = detachedClone(\n\t\t\t\tthis._detachOnNextRender,\n\t\t\t\tdetachedParent,\n\t\t\t\t(detachedComponent._originalParentDom = detachedComponent._parentDom)\n\t\t\t);\n\t\t}\n\n\t\tthis._detachOnNextRender = null;\n\t}\n\n\t// Wrap fallback tree in a VNode that prevents itself from being marked as aborting mid-hydration:\n\t/** @type {import('./internal').VNode} */\n\tconst fallback =\n\t\tstate._suspended && createElement(Fragment, null, props.fallback);\n\tif (fallback) fallback._flags &= ~MODE_HYDRATE;\n\n\treturn [\n\t\tcreateElement(Fragment, null, state._suspended ? null : props.children),\n\t\tfallback\n\t];\n};\n\n/**\n * Checks and calls the parent component's _suspended method, passing in the\n * suspended vnode. This is a way for a parent (e.g. SuspenseList) to get notified\n * that one of its children/descendants suspended.\n *\n * The parent MAY return a callback. The callback will get called when the\n * suspension resolves, notifying the parent of the fact.\n * Moreover, the callback gets function `unsuspend` as a parameter. The resolved\n * child descendant will not actually get unsuspended until `unsuspend` gets called.\n * This is a way for the parent to delay unsuspending.\n *\n * If the parent does not return a callback then the resolved vnode\n * gets unsuspended immediately when it resolves.\n *\n * @param {import('./internal').VNode} vnode\n * @returns {((unsuspend: () => void) => void)?}\n */\nexport function suspended(vnode) {\n\tif (!vnode._parent) return null;\n\t/** @type {import('./internal').Component} */\n\tlet component = vnode._parent._component;\n\treturn component && component._suspended && component._suspended(vnode);\n}\n\nexport function lazy(loader) {\n\tlet prom;\n\tlet component = null;\n\tlet error;\n\tlet resolved;\n\n\tfunction Lazy(props) {\n\t\tif (!prom) {\n\t\t\tprom = loader();\n\t\t\tprom.then(\n\t\t\t\texports => {\n\t\t\t\t\tif (exports) {\n\t\t\t\t\t\tcomponent = exports.default || exports;\n\t\t\t\t\t}\n\t\t\t\t\tresolved = true;\n\t\t\t\t},\n\t\t\t\te => {\n\t\t\t\t\terror = e;\n\t\t\t\t\tresolved = true;\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\n\t\tif (error) {\n\t\t\tthrow error;\n\t\t}\n\n\t\tif (!resolved) {\n\t\t\tthrow prom;\n\t\t}\n\n\t\treturn component ? createElement(component, props) : null;\n\t}\n\n\tLazy.displayName = 'Lazy';\n\tLazy._forwarded = true;\n\treturn Lazy;\n}\n","import { Component, toChildArray } from 'preact';\nimport { suspended } from './suspense.js';\n\n// Indexes to linked list nodes (nodes are stored as arrays to save bytes).\nconst SUSPENDED_COUNT = 0;\nconst RESOLVED_COUNT = 1;\nconst NEXT_NODE = 2;\n\n// Having custom inheritance instead of a class here saves a lot of bytes.\nexport function SuspenseList() {\n\tthis._next = null;\n\tthis._map = null;\n}\n\n// Mark one of child's earlier suspensions as resolved.\n// Some pending callbacks may become callable due to this\n// (e.g. the last suspended descendant gets resolved when\n// revealOrder === 'together'). Process those callbacks as well.\nconst resolve = (list, child, node) => {\n\tif (++node[RESOLVED_COUNT] === node[SUSPENDED_COUNT]) {\n\t\t// The number a child (or any of its descendants) has been suspended\n\t\t// matches the number of times it's been resolved. Therefore we\n\t\t// mark the child as completely resolved by deleting it from ._map.\n\t\t// This is used to figure out when *all* children have been completely\n\t\t// resolved when revealOrder is 'together'.\n\t\tlist._map.delete(child);\n\t}\n\n\t// If revealOrder is falsy then we can do an early exit, as the\n\t// callbacks won't get queued in the node anyway.\n\t// If revealOrder is 'together' then also do an early exit\n\t// if all suspended descendants have not yet been resolved.\n\tif (\n\t\t!list.props.revealOrder ||\n\t\t(list.props.revealOrder[0] === 't' && list._map.size)\n\t) {\n\t\treturn;\n\t}\n\n\t// Walk the currently suspended children in order, calling their\n\t// stored callbacks on the way. Stop if we encounter a child that\n\t// has not been completely resolved yet.\n\tnode = list._next;\n\twhile (node) {\n\t\twhile (node.length > 3) {\n\t\t\tnode.pop()();\n\t\t}\n\t\tif (node[RESOLVED_COUNT] < node[SUSPENDED_COUNT]) {\n\t\t\tbreak;\n\t\t}\n\t\tlist._next = node = node[NEXT_NODE];\n\t}\n};\n\n// Things we do here to save some bytes but are not proper JS inheritance:\n// - call `new Component()` as the prototype\n// - do not set `Suspense.prototype.constructor` to `Suspense`\nSuspenseList.prototype = new Component();\n\nSuspenseList.prototype._suspended = function (child) {\n\tconst list = this;\n\tconst delegated = suspended(list._vnode);\n\n\tlet node = list._map.get(child);\n\tnode[SUSPENDED_COUNT]++;\n\n\treturn unsuspend => {\n\t\tconst wrappedUnsuspend = () => {\n\t\t\tif (!list.props.revealOrder) {\n\t\t\t\t// Special case the undefined (falsy) revealOrder, as there\n\t\t\t\t// is no need to coordinate a specific order or unsuspends.\n\t\t\t\tunsuspend();\n\t\t\t} else {\n\t\t\t\tnode.push(unsuspend);\n\t\t\t\tresolve(list, child, node);\n\t\t\t}\n\t\t};\n\t\tif (delegated) {\n\t\t\tdelegated(wrappedUnsuspend);\n\t\t} else {\n\t\t\twrappedUnsuspend();\n\t\t}\n\t};\n};\n\nSuspenseList.prototype.render = function (props) {\n\tthis._next = null;\n\tthis._map = new Map();\n\n\tconst children = toChildArray(props.children);\n\tif (props.revealOrder && props.revealOrder[0] === 'b') {\n\t\t// If order === 'backwards' (or, well, anything starting with a 'b')\n\t\t// then flip the child list around so that the last child will be\n\t\t// the first in the linked list.\n\t\tchildren.reverse();\n\t}\n\t// Build the linked list. Iterate through the children in reverse order\n\t// so that `_next` points to the first linked list node to be resolved.\n\tfor (let i = children.length; i--; ) {\n\t\t// Create a new linked list node as an array of form:\n\t\t// \t[suspended_count, resolved_count, next_node]\n\t\t// where suspended_count and resolved_count are numeric counters for\n\t\t// keeping track how many times a node has been suspended and resolved.\n\t\t//\n\t\t// Note that suspended_count starts from 1 instead of 0, so we can block\n\t\t// processing callbacks until componentDidMount has been called. In a sense\n\t\t// node is suspended at least until componentDidMount gets called!\n\t\t//\n\t\t// Pending callbacks are added to the end of the node:\n\t\t// \t[suspended_count, resolved_count, next_node, callback_0, callback_1, ...]\n\t\tthis._map.set(children[i], (this._next = [1, 0, this._next]));\n\t}\n\treturn props.children;\n};\n\nSuspenseList.prototype.componentDidUpdate =\n\tSuspenseList.prototype.componentDidMount = function () {\n\t\t// Iterate through all children after mounting for two reasons:\n\t\t// 1. As each node[SUSPENDED_COUNT] starts from 1, this iteration increases\n\t\t// each node[RELEASED_COUNT] by 1, therefore balancing the counters.\n\t\t// The nodes can now be completely consumed from the linked list.\n\t\t// 2. Handle nodes that might have gotten resolved between render and\n\t\t// componentDidMount.\n\t\tthis._map.forEach((node, child) => {\n\t\t\tresolve(this, child, node);\n\t\t});\n\t};\n","import { createElement, render } from 'preact';\n\n/**\n * @param {import('../../src/index').RenderableProps<{ context: any }>} props\n */\nfunction ContextProvider(props) {\n\tthis.getChildContext = () => props.context;\n\treturn props.children;\n}\n\n/**\n * Portal component\n * @this {import('./internal').Component}\n * @param {object | null | undefined} props\n *\n * TODO: use createRoot() instead of fake root\n */\nfunction Portal(props) {\n\tconst _this = this;\n\tlet container = props._container;\n\n\t_this.componentWillUnmount = function () {\n\t\trender(null, _this._temp);\n\t\t_this._temp = null;\n\t\t_this._container = null;\n\t};\n\n\t// When we change container we should clear our old container and\n\t// indicate a new mount.\n\tif (_this._container && _this._container !== container) {\n\t\t_this.componentWillUnmount();\n\t}\n\n\tif (!_this._temp) {\n\t\t// Ensure the element has a mask for useId invocations\n\t\tlet root = _this._vnode;\n\t\twhile (root !== null && !root._mask && root._parent !== null) {\n\t\t\troot = root._parent;\n\t\t}\n\n\t\t_this._container = container;\n\n\t\t// Create a fake DOM parent node that manages a subset of `container`'s children:\n\t\t_this._temp = {\n\t\t\tnodeType: 1,\n\t\t\tparentNode: container,\n\t\t\tchildNodes: [],\n\t\t\t_children: { _mask: root._mask },\n\t\t\tcontains: () => true,\n\t\t\tnamespaceURI: container.namespaceURI,\n\t\t\tinsertBefore(child, before) {\n\t\t\t\tthis.childNodes.push(child);\n\t\t\t\t_this._container.insertBefore(child, before);\n\t\t\t},\n\t\t\tremoveChild(child) {\n\t\t\t\tthis.childNodes.splice(this.childNodes.indexOf(child) >>> 1, 1);\n\t\t\t\t_this._container.removeChild(child);\n\t\t\t}\n\t\t};\n\t}\n\n\t// Render our wrapping element into temp.\n\trender(\n\t\tcreateElement(ContextProvider, { context: _this.context }, props._vnode),\n\t\t_this._temp\n\t);\n}\n\n/**\n * Create a `Portal` to continue rendering the vnode tree at a different DOM node\n * @param {import('./internal').VNode} vnode The vnode to render\n * @param {import('./internal').PreactElement} container The DOM node to continue rendering in to.\n */\nexport function createPortal(vnode, container) {\n\tconst el = createElement(Portal, { _vnode: vnode, _container: container });\n\tel.containerInfo = container;\n\treturn el;\n}\n","import {\n\trender as preactRender,\n\thydrate as preactHydrate,\n\toptions,\n\ttoChildArray,\n\tComponent\n} from 'preact';\nimport {\n\tuseCallback,\n\tuseContext,\n\tuseDebugValue,\n\tuseEffect,\n\tuseId,\n\tuseImperativeHandle,\n\tuseLayoutEffect,\n\tuseMemo,\n\tuseReducer,\n\tuseRef,\n\tuseState\n} from 'preact/hooks';\nimport {\n\tuseDeferredValue,\n\tuseInsertionEffect,\n\tuseSyncExternalStore,\n\tuseTransition\n} from './index';\n\nexport const REACT_ELEMENT_TYPE =\n\t(typeof Symbol != 'undefined' && Symbol.for && Symbol.for('react.element')) ||\n\t0xeac7;\n\nconst CAMEL_PROPS =\n\t/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/;\nconst ON_ANI = /^on(Ani|Tra|Tou|BeforeInp|Compo)/;\nconst CAMEL_REPLACE = /[A-Z0-9]/g;\nconst IS_DOM = typeof document !== 'undefined';\n\n// Input types for which onchange should not be converted to oninput.\n// type=\"file|checkbox|radio\", plus \"range\" in IE11.\n// (IE11 doesn't support Symbol, which we use here to turn `rad` into `ra` which matches \"range\")\nconst onChangeInputType = type =>\n\t(typeof Symbol != 'undefined' && typeof Symbol() == 'symbol'\n\t\t? /fil|che|rad/\n\t\t: /fil|che|ra/\n\t).test(type);\n\n// Some libraries like `react-virtualized` explicitly check for this.\nComponent.prototype.isReactComponent = {};\n\n// `UNSAFE_*` lifecycle hooks\n// Preact only ever invokes the unprefixed methods.\n// Here we provide a base \"fallback\" implementation that calls any defined UNSAFE_ prefixed method.\n// - If a component defines its own `componentDidMount()` (including via defineProperty), use that.\n// - If a component defines `UNSAFE_componentDidMount()`, `componentDidMount` is the alias getter/setter.\n// - If anything assigns to an `UNSAFE_*` property, the assignment is forwarded to the unprefixed property.\n// See https://github.com/preactjs/preact/issues/1941\n[\n\t'componentWillMount',\n\t'componentWillReceiveProps',\n\t'componentWillUpdate'\n].forEach(key => {\n\tObject.defineProperty(Component.prototype, key, {\n\t\tconfigurable: true,\n\t\tget() {\n\t\t\treturn this['UNSAFE_' + key];\n\t\t},\n\t\tset(v) {\n\t\t\tObject.defineProperty(this, key, {\n\t\t\t\tconfigurable: true,\n\t\t\t\twritable: true,\n\t\t\t\tvalue: v\n\t\t\t});\n\t\t}\n\t});\n});\n\n/**\n * Proxy render() since React returns a Component reference.\n * @param {import('./internal').VNode} vnode VNode tree to render\n * @param {import('./internal').PreactElement} parent DOM node to render vnode tree into\n * @param {() => void} [callback] Optional callback that will be called after rendering\n * @returns {import('./internal').Component | null} The root component reference or null\n */\nexport function render(vnode, parent, callback) {\n\t// React destroys any existing DOM nodes, see #1727\n\t// ...but only on the first render, see #1828\n\tif (parent._children == null) {\n\t\tparent.textContent = '';\n\t}\n\n\tpreactRender(vnode, parent);\n\tif (typeof callback == 'function') callback();\n\n\treturn vnode ? vnode._component : null;\n}\n\nexport function hydrate(vnode, parent, callback) {\n\tpreactHydrate(vnode, parent);\n\tif (typeof callback == 'function') callback();\n\n\treturn vnode ? vnode._component : null;\n}\n\nlet oldEventHook = options.event;\noptions.event = e => {\n\tif (oldEventHook) e = oldEventHook(e);\n\n\te.persist = empty;\n\te.isPropagationStopped = isPropagationStopped;\n\te.isDefaultPrevented = isDefaultPrevented;\n\treturn (e.nativeEvent = e);\n};\n\nfunction empty() {}\n\nfunction isPropagationStopped() {\n\treturn this.cancelBubble;\n}\n\nfunction isDefaultPrevented() {\n\treturn this.defaultPrevented;\n}\n\nconst classNameDescriptorNonEnumberable = {\n\tenumerable: false,\n\tconfigurable: true,\n\tget() {\n\t\treturn this.class;\n\t}\n};\n\nfunction handleDomVNode(vnode) {\n\tlet props = vnode.props,\n\t\ttype = vnode.type,\n\t\tnormalizedProps = {};\n\n\tlet isNonDashedType = type.indexOf('-') === -1;\n\tfor (let i in props) {\n\t\tlet value = props[i];\n\n\t\tif (\n\t\t\t(i === 'value' && 'defaultValue' in props && value == null) ||\n\t\t\t// Emulate React's behavior of not rendering the contents of noscript tags on the client.\n\t\t\t(IS_DOM && i === 'children' && type === 'noscript') ||\n\t\t\ti === 'class' ||\n\t\t\ti === 'className'\n\t\t) {\n\t\t\t// Skip applying value if it is null/undefined and we already set\n\t\t\t// a default value\n\t\t\tcontinue;\n\t\t}\n\n\t\tlet lowerCased = i.toLowerCase();\n\t\tif (i === 'defaultValue' && 'value' in props && props.value == null) {\n\t\t\t// `defaultValue` is treated as a fallback `value` when a value prop is present but null/undefined.\n\t\t\t// `defaultValue` for Elements with no value prop is the same as the DOM defaultValue property.\n\t\t\ti = 'value';\n\t\t} else if (i === 'download' && value === true) {\n\t\t\t// Calling `setAttribute` with a truthy value will lead to it being\n\t\t\t// passed as a stringified value, e.g. `download=\"true\"`. React\n\t\t\t// converts it to an empty string instead, otherwise the attribute\n\t\t\t// value will be used as the file name and the file will be called\n\t\t\t// \"true\" upon downloading it.\n\t\t\tvalue = '';\n\t\t} else if (lowerCased === 'translate' && value === 'no') {\n\t\t\tvalue = false;\n\t\t} else if (lowerCased[0] === 'o' && lowerCased[1] === 'n') {\n\t\t\tif (lowerCased === 'ondoubleclick') {\n\t\t\t\ti = 'ondblclick';\n\t\t\t} else if (\n\t\t\t\tlowerCased === 'onchange' &&\n\t\t\t\t(type === 'input' || type === 'textarea') &&\n\t\t\t\t!onChangeInputType(props.type)\n\t\t\t) {\n\t\t\t\tlowerCased = i = 'oninput';\n\t\t\t} else if (lowerCased === 'onfocus') {\n\t\t\t\ti = 'onfocusin';\n\t\t\t} else if (lowerCased === 'onblur') {\n\t\t\t\ti = 'onfocusout';\n\t\t\t} else if (ON_ANI.test(i)) {\n\t\t\t\ti = lowerCased;\n\t\t\t}\n\t\t} else if (isNonDashedType && CAMEL_PROPS.test(i)) {\n\t\t\ti = i.replace(CAMEL_REPLACE, '-$&').toLowerCase();\n\t\t} else if (value === null) {\n\t\t\tvalue = undefined;\n\t\t}\n\n\t\t// Add support for onInput and onChange, see #3561\n\t\t// if we have an oninput prop already change it to oninputCapture\n\t\tif (lowerCased === 'oninput') {\n\t\t\ti = lowerCased;\n\t\t\tif (normalizedProps[i]) {\n\t\t\t\ti = 'oninputCapture';\n\t\t\t}\n\t\t}\n\n\t\tnormalizedProps[i] = value;\n\t}\n\n\t// Add support for array select values: <select multiple value={[]} />\n\tif (\n\t\ttype == 'select' &&\n\t\tnormalizedProps.multiple &&\n\t\tArray.isArray(normalizedProps.value)\n\t) {\n\t\t// forEach() always returns undefined, which we abuse here to unset the value prop.\n\t\tnormalizedProps.value = toChildArray(props.children).forEach(child => {\n\t\t\tchild.props.selected =\n\t\t\t\tnormalizedProps.value.indexOf(child.props.value) != -1;\n\t\t});\n\t}\n\n\t// Adding support for defaultValue in select tag\n\tif (type == 'select' && normalizedProps.defaultValue != null) {\n\t\tnormalizedProps.value = toChildArray(props.children).forEach(child => {\n\t\t\tif (normalizedProps.multiple) {\n\t\t\t\tchild.props.selected =\n\t\t\t\t\tnormalizedProps.defaultValue.indexOf(child.props.value) != -1;\n\t\t\t} else {\n\t\t\t\tchild.props.selected =\n\t\t\t\t\tnormalizedProps.defaultValue == child.props.value;\n\t\t\t}\n\t\t});\n\t}\n\n\tif (props.class && !props.className) {\n\t\tnormalizedProps.class = props.class;\n\t\tObject.defineProperty(\n\t\t\tnormalizedProps,\n\t\t\t'className',\n\t\t\tclassNameDescriptorNonEnumberable\n\t\t);\n\t} else if (props.className && !props.class) {\n\t\tnormalizedProps.class = normalizedProps.className = props.className;\n\t} else if (props.class && props.className) {\n\t\tnormalizedProps.class = normalizedProps.className = props.className;\n\t}\n\n\tvnode.props = normalizedProps;\n}\n\nlet oldVNodeHook = options.vnode;\noptions.vnode = vnode => {\n\t// only normalize props on Element nodes\n\tif (typeof vnode.type === 'string') {\n\t\thandleDomVNode(vnode);\n\t}\n\n\tvnode.$$typeof = REACT_ELEMENT_TYPE;\n\n\tif (oldVNodeHook) oldVNodeHook(vnode);\n};\n\n// Only needed for react-relay\nlet currentComponent;\nconst oldBeforeRender = options._render;\noptions._render = function (vnode) {\n\tif (oldBeforeRender) {\n\t\toldBeforeRender(vnode);\n\t}\n\tcurrentComponent = vnode._component;\n};\n\nconst oldDiffed = options.diffed;\n/** @type {(vnode: import('./internal').VNode) => void} */\noptions.diffed = function (vnode) {\n\tif (oldDiffed) {\n\t\toldDiffed(vnode);\n\t}\n\n\tconst props = vnode.props;\n\tconst dom = vnode._dom;\n\n\tif (\n\t\tdom != null &&\n\t\tvnode.type === 'textarea' &&\n\t\t'value' in props &&\n\t\tprops.value !== dom.value\n\t) {\n\t\tdom.value = props.value == null ? '' : props.value;\n\t}\n\n\tcurrentComponent = null;\n};\n\n// This is a very very private internal function for React it\n// is used to sort-of do runtime dependency injection.\nexport const __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = {\n\tReactCurrentDispatcher: {\n\t\tcurrent: {\n\t\t\treadContext(context) {\n\t\t\t\treturn currentComponent._globalContext[context._id].props.value;\n\t\t\t},\n\t\t\tuseCallback,\n\t\t\tuseContext,\n\t\t\tuseDebugValue,\n\t\t\tuseDeferredValue,\n\t\t\tuseEffect,\n\t\t\tuseId,\n\t\t\tuseImperativeHandle,\n\t\t\tuseInsertionEffect,\n\t\t\tuseLayoutEffect,\n\t\t\tuseMemo,\n\t\t\t// useMutableSource, // experimental-only and replaced by uSES, likely not worth supporting\n\t\t\tuseReducer,\n\t\t\tuseRef,\n\t\t\tuseState,\n\t\t\tuseSyncExternalStore,\n\t\t\tuseTransition\n\t\t}\n\t}\n};\n","import {\n\tcreateElement,\n\trender as preactRender,\n\tcloneElement as preactCloneElement,\n\tcreateRef,\n\tComponent,\n\tcreateContext,\n\tFragment\n} from 'preact';\nimport {\n\tuseState,\n\tuseId,\n\tuseReducer,\n\tuseEffect,\n\tuseLayoutEffect,\n\tuseRef,\n\tuseImperativeHandle,\n\tuseMemo,\n\tuseCallback,\n\tuseContext,\n\tuseDebugValue\n} from 'preact/hooks';\nimport {\n\tuseInsertionEffect,\n\tstartTransition,\n\tuseDeferredValue,\n\tuseSyncExternalStore,\n\tuseTransition\n} from './hooks';\nimport { PureComponent } from './PureComponent';\nimport { memo } from './memo';\nimport { forwardRef } from './forwardRef';\nimport { Children } from './Children';\nimport { Suspense, lazy } from './suspense';\nimport { SuspenseList } from './suspense-list';\nimport { createPortal } from './portals';\nimport {\n\thydrate,\n\trender,\n\tREACT_ELEMENT_TYPE,\n\t__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED\n} from './render';\n\nconst version = '18.3.1'; // trick libraries to think we are react\n\n/**\n * Legacy version of createElement.\n * @param {import('./internal').VNode[\"type\"]} type The node name or Component constructor\n */\nfunction createFactory(type) {\n\treturn createElement.bind(null, type);\n}\n\n/**\n * Check if the passed element is a valid (p)react node.\n * @param {*} element The element to check\n * @returns {boolean}\n */\nfunction isValidElement(element) {\n\treturn !!element && element.$$typeof === REACT_ELEMENT_TYPE;\n}\n\n/**\n * Check if the passed element is a Fragment node.\n * @param {*} element The element to check\n * @returns {boolean}\n */\nfunction isFragment(element) {\n\treturn isValidElement(element) && element.type === Fragment;\n}\n\n/**\n * Check if the passed element is a Memo node.\n * @param {*} element The element to check\n * @returns {boolean}\n */\nfunction isMemo(element) {\n\treturn (\n\t\t!!element &&\n\t\t!!element.displayName &&\n\t\t(typeof element.displayName === 'string' ||\n\t\t\telement.displayName instanceof String) &&\n\t\telement.displayName.startsWith('Memo(')\n\t);\n}\n\n/**\n * Wrap `cloneElement` to abort if the passed element is not a valid element and apply\n * all vnode normalizations.\n * @param {import('./internal').VNode} element The vnode to clone\n * @param {object} props Props to add when cloning\n * @param {Array<import('./internal').ComponentChildren>} rest Optional component children\n */\nfunction cloneElement(element) {\n\tif (!isValidElement(element)) return element;\n\treturn preactCloneElement.apply(null, arguments);\n}\n\n/**\n * Remove a component tree from the DOM, including state and event handlers.\n * @param {import('./internal').PreactElement} container\n * @returns {boolean}\n */\nfunction unmountComponentAtNode(container) {\n\tif (container._children) {\n\t\tpreactRender(null, container);\n\t\treturn true;\n\t}\n\treturn false;\n}\n\n/**\n * Get the matching DOM node for a component\n * @param {import('./internal').Component} component\n * @returns {import('./internal').PreactElement | null}\n */\nfunction findDOMNode(component) {\n\treturn (\n\t\t(component &&\n\t\t\t(component.base || (component.nodeType === 1 && component))) ||\n\t\tnull\n\t);\n}\n\n/**\n * Deprecated way to control batched rendering inside the reconciler, but we\n * already schedule in batches inside our rendering code\n * @template Arg\n * @param {(arg: Arg) => void} callback function that triggers the updated\n * @param {Arg} [arg] Optional argument that can be passed to the callback\n */\n// eslint-disable-next-line camelcase\nconst unstable_batchedUpdates = (callback, arg) => callback(arg);\n\n/**\n * In React, `flushSync` flushes the entire tree and forces a rerender. It's\n * implmented here as a no-op.\n * @template Arg\n * @template Result\n * @param {(arg: Arg) => Result} callback function that runs before the flush\n * @param {Arg} [arg] Optional argument that can be passed to the callback\n * @returns\n */\nconst flushSync = (callback, arg) => callback(arg);\n\n/**\n * Strict Mode is not implemented in Preact, so we provide a stand-in for it\n * that just renders its children without imposing any restrictions.\n */\nconst StrictMode = Fragment;\n\n// compat to react-is\nexport const isElement = isValidElement;\n\nexport * from 'preact/hooks';\nexport {\n\tversion,\n\tChildren,\n\trender,\n\thydrate,\n\tunmountComponentAtNode,\n\tcreatePortal,\n\tcreateElement,\n\tcreateContext,\n\tcreateFactory,\n\tcloneElement,\n\tcreateRef,\n\tFragment,\n\tisValidElement,\n\tisFragment,\n\tisMemo,\n\tfindDOMNode,\n\tComponent,\n\tPureComponent,\n\tmemo,\n\tforwardRef,\n\tflushSync,\n\tuseInsertionEffect,\n\tstartTransition,\n\tuseDeferredValue,\n\tuseSyncExternalStore,\n\tuseTransition,\n\t// eslint-disable-next-line camelcase\n\tunstable_batchedUpdates,\n\tStrictMode,\n\tSuspense,\n\tSuspenseList,\n\tlazy,\n\t__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED\n};\n\n// React copies the named exports to the default one.\nexport default {\n\tuseState,\n\tuseId,\n\tuseReducer,\n\tuseEffect,\n\tuseLayoutEffect,\n\tuseInsertionEffect,\n\tuseTransition,\n\tuseDeferredValue,\n\tuseSyncExternalStore,\n\tstartTransition,\n\tuseRef,\n\tuseImperativeHandle,\n\tuseMemo,\n\tuseCallback,\n\tuseContext,\n\tuseDebugValue,\n\tversion,\n\tChildren,\n\trender,\n\thydrate,\n\tunmountComponentAtNode,\n\tcreatePortal,\n\tcreateElement,\n\tcreateContext,\n\tcreateFactory,\n\tcloneElement,\n\tcreateRef,\n\tFragment,\n\tisValidElement,\n\tisElement,\n\tisFragment,\n\tisMemo,\n\tfindDOMNode,\n\tComponent,\n\tPureComponent,\n\tmemo,\n\tforwardRef,\n\tflushSync,\n\tunstable_batchedUpdates,\n\tStrictMode,\n\tSuspense,\n\tSuspenseList,\n\tlazy,\n\t__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED\n};\n","function r(e){var t,f,n=\"\";if(\"string\"==typeof e||\"number\"==typeof e)n+=e;else if(\"object\"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=\" \"),n+=f);else for(t in e)e[t]&&(n&&(n+=\" \"),n+=t);return n}export function clsx(){for(var e,t,f=0,n=\"\";f<arguments.length;)(e=arguments[f++])&&(t=r(e))&&(n&&(n+=\" \"),n+=t);return n}export default clsx;","import { options, Fragment } from 'preact';\nimport { encodeEntities } from './utils';\nimport { IS_NON_DIMENSIONAL } from '../../src/constants';\n\nlet vnodeId = 0;\n\nconst isArray = Array.isArray;\n\n/**\n * @fileoverview\n * This file exports various methods that implement Babel's \"automatic\" JSX runtime API:\n * - jsx(type, props, key)\n * - jsxs(type, props, key)\n * - jsxDEV(type, props, key, __source, __self)\n *\n * The implementation of createVNode here is optimized for performance.\n * Benchmarks: https://esbench.com/bench/5f6b54a0b4632100a7dcd2b3\n */\n\n/**\n * JSX.Element factory used by Babel's {runtime:\"automatic\"} JSX transform\n * @param {VNode['type']} type\n * @param {VNode['props']} props\n * @param {VNode['key']} [key]\n * @param {unknown} [isStaticChildren]\n * @param {unknown} [__source]\n * @param {unknown} [__self]\n */\nfunction createVNode(type, props, key, isStaticChildren, __source, __self) {\n\tif (!props) props = {};\n\t// We'll want to preserve `ref` in props to get rid of the need for\n\t// forwardRef components in the future, but that should happen via\n\t// a separate PR.\n\tlet normalizedProps = props,\n\t\tref,\n\t\ti;\n\n\tif ('ref' in normalizedProps) {\n\t\tnormalizedProps = {};\n\t\tfor (i in props) {\n\t\t\tif (i == 'ref') {\n\t\t\t\tref = props[i];\n\t\t\t} else {\n\t\t\t\tnormalizedProps[i] = props[i];\n\t\t\t}\n\t\t}\n\t}\n\n\t/** @type {VNode & { __source: any; __self: any }} */\n\tconst vnode = {\n\t\ttype,\n\t\tprops: normalizedProps,\n\t\tkey,\n\t\tref,\n\t\t_children: null,\n\t\t_parent: null,\n\t\t_depth: 0,\n\t\t_dom: null,\n\t\t_component: null,\n\t\tconstructor: undefined,\n\t\t_original: --vnodeId,\n\t\t_index: -1,\n\t\t_flags: 0,\n\t\t__source,\n\t\t__self\n\t};\n\n\t// If a Component VNode, check for and apply defaultProps.\n\t// Note: `type` is often a String, and can be `undefined` in development.\n\tif (typeof type === 'function' && (ref = type.defaultProps)) {\n\t\tfor (i in ref)\n\t\t\tif (normalizedProps[i] === undefined) {\n\t\t\t\tnormalizedProps[i] = ref[i];\n\t\t\t}\n\t}\n\n\tif (options.vnode) options.vnode(vnode);\n\treturn vnode;\n}\n\n/**\n * Create a template vnode. This function is not expected to be\n * used directly, but rather through a precompile JSX transform\n * @param {string[]} templates\n * @param {Array<string | null | VNode>} exprs\n * @returns {VNode}\n */\nfunction jsxTemplate(templates, ...exprs) {\n\tconst vnode = createVNode(Fragment, { tpl: templates, exprs });\n\t// Bypass render to string top level Fragment optimization\n\tvnode.key = vnode._vnode;\n\treturn vnode;\n}\n\nconst JS_TO_CSS = {};\nconst CSS_REGEX = /[A-Z]/g;\n\n/**\n * Unwrap potential signals.\n * @param {*} value\n * @returns {*}\n */\nfunction normalizeAttrValue(value) {\n\treturn value !== null &&\n\t\ttypeof value === 'object' &&\n\t\ttypeof value.valueOf === 'function'\n\t\t? value.valueOf()\n\t\t: value;\n}\n\n/**\n * Serialize an HTML attribute to a string. This function is not\n * expected to be used directly, but rather through a precompile\n * JSX transform\n * @param {string} name The attribute name\n * @param {*} value The attribute value\n * @returns {string}\n */\nfunction jsxAttr(name, value) {\n\tif (options.attr) {\n\t\tconst result = options.attr(name, value);\n\t\tif (typeof result === 'string') return result;\n\t}\n\n\tvalue = normalizeAttrValue(value);\n\n\tif (name === 'ref' || name === 'key') return '';\n\tif (name === 'style' && typeof value === 'object') {\n\t\tlet str = '';\n\t\tfor (let prop in value) {\n\t\t\tlet val = value[prop];\n\t\t\tif (val != null && val !== '') {\n\t\t\t\tconst name =\n\t\t\t\t\tprop[0] == '-'\n\t\t\t\t\t\t? prop\n\t\t\t\t\t\t: JS_TO_CSS[prop] ||\n\t\t\t\t\t\t\t(JS_TO_CSS[prop] = prop.replace(CSS_REGEX, '-$&').toLowerCase());\n\n\t\t\t\tlet suffix = ';';\n\t\t\t\tif (\n\t\t\t\t\ttypeof val === 'number' &&\n\t\t\t\t\t// Exclude custom-attributes\n\t\t\t\t\t!name.startsWith('--') &&\n\t\t\t\t\t!IS_NON_DIMENSIONAL.test(name)\n\t\t\t\t) {\n\t\t\t\t\tsuffix = 'px;';\n\t\t\t\t}\n\t\t\t\tstr = str + name + ':' + val + suffix;\n\t\t\t}\n\t\t}\n\t\treturn name + '=\"' + encodeEntities(str) + '\"';\n\t}\n\n\tif (\n\t\tvalue == null ||\n\t\tvalue === false ||\n\t\ttypeof value === 'function' ||\n\t\ttypeof value === 'object'\n\t) {\n\t\treturn '';\n\t} else if (value === true) return name;\n\n\treturn name + '=\"' + encodeEntities('' + value) + '\"';\n}\n\n/**\n * Escape a dynamic child passed to `jsxTemplate`. This function\n * is not expected to be used directly, but rather through a\n * precompile JSX transform\n * @param {*} value\n * @returns {string | null | VNode | Array<string | null | VNode>}\n */\nfunction jsxEscape(value) {\n\tif (\n\t\tvalue == null ||\n\t\ttypeof value === 'boolean' ||\n\t\ttypeof value === 'function'\n\t) {\n\t\treturn null;\n\t}\n\n\tif (typeof value === 'object') {\n\t\t// Check for VNode\n\t\tif (value.constructor === undefined) return value;\n\n\t\tif (isArray(value)) {\n\t\t\tfor (let i = 0; i < value.length; i++) {\n\t\t\t\tvalue[i] = jsxEscape(value[i]);\n\t\t\t}\n\t\t\treturn value;\n\t\t}\n\t}\n\n\treturn encodeEntities('' + value);\n}\n\nexport {\n\tcreateVNode as jsx,\n\tcreateVNode as jsxs,\n\tcreateVNode as jsxDEV,\n\tFragment,\n\t// precompiled JSX transform\n\tjsxTemplate,\n\tjsxAttr,\n\tjsxEscape\n};\n","function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n","import { css } from '@linaria/core';\n\nexport const cell = css`\n contain: strict;\n contain: size layout style paint;\n padding: 0 8px;\n border-right: 1px solid var(--border-color);\n border-bottom: 1px solid var(--border-color);\n background-color: inherit;\n\n white-space: nowrap;\n overflow: hidden;\n overflow: clip;\n text-overflow: ellipsis;\n\n &[aria-selected='true'] {\n box-shadow: inset 0 0 0 2px var(--selection-color);\n }\n`;\n\nexport const cellClassname = `rdg-cell ${cell}`;\n\nconst cellFrozen = css`\n position: sticky;\n // Should have a higher value than 0 to show up above unfrozen cells\n z-index: 1;\n`;\n\nexport const cellFrozenClassname = `rdg-cell-frozen ${cellFrozen}`;\n\nexport const cellFrozenLast = css`\n box-shadow: 2px 0 5px -2px rgba(136, 136, 136, 0.3);\n`;\n\nexport const cellFrozenLastClassname = `rdg-cell-frozen-last ${cellFrozenLast}`;\n","import { css } from '@linaria/core';\nimport { row } from './row';\n\nconst lightTheme = `\n --color: #000;\n --border-color: #ddd;\n --summary-border-color: #aaa;\n --background-color: hsl(0deg 0% 100%);\n --header-background-color: hsl(0deg 0% 97.5%);\n --row-hover-background-color: hsl(0deg 0% 96%);\n --row-selected-background-color: hsl(207deg 76% 92%);\n --row-selected-hover-background-color: hsl(207deg 76% 88%);\n\n --checkbox-color: hsl(207deg 100% 29%);\n --checkbox-focus-color: hsl(207deg 100% 69%);\n --checkbox-disabled-border-color: #ccc;\n --checkbox-disabled-background-color: #ddd;\n`;\n\nconst darkTheme = `\n --color: #ddd;\n --border-color: #444;\n --summary-border-color: #555;\n --background-color: hsl(0deg 0% 13%);\n --header-background-color: hsl(0deg 0% 10.5%);\n --row-hover-background-color: hsl(0deg 0% 9%);\n --row-selected-background-color: hsl(207deg 76% 42%);\n --row-selected-hover-background-color: hsl(207deg 76% 38%);\n\n --checkbox-color: hsl(207deg 100% 79%);\n --checkbox-focus-color: hsl(207deg 100% 89%);\n --checkbox-disabled-border-color: #000;\n --checkbox-disabled-background-color: #333;\n`;\n\nconst root = css`\n ${lightTheme}\n --selection-color: #66afe9;\n --font-size: 14px;\n\n // https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Positioning/Understanding_z_index/The_stacking_context\n // We set a stacking context so internal elements don't render on top of external components.\n contain: strict;\n contain: size layout style paint;\n content-visibility: auto;\n height: 350px;\n border: 1px solid var(--border-color);\n box-sizing: border-box;\n overflow: auto;\n user-select: none;\n background-color: var(--background-color);\n color: var(--color);\n font-size: var(--font-size);\n\n // set stacking context in safari\n @supports not (contain: strict) {\n position: relative;\n z-index: 0;\n }\n\n *,\n *::before,\n *::after {\n box-sizing: inherit;\n }\n\n &.rdg-dark {\n ${darkTheme}\n }\n\n @media (prefers-color-scheme: dark) {\n &:not(.rdg-light) {\n ${darkTheme}\n }\n }\n`;\n\nexport const rootClassname = `rdg ${root}`;\n\nconst focusSink = css`\n position: sticky;\n top: 0;\n left: 0;\n height: 0;\n width: 0;\n outline: 0;\n`;\n\nexport const focusSinkClassname = `rdg-focus-sink ${focusSink}`;\n\nconst viewportDragging = css`\n &.${row} {\n cursor: move;\n }\n`;\n\nexport const viewportDraggingClassname = `rdg-viewport-dragging ${viewportDragging}`;\n","import { css } from '@linaria/core';\nimport { cell, cellFrozenLast } from './cell';\n\nconst groupRow = css`\n &:not([aria-selected='true']) {\n background-color: var(--header-background-color);\n }\n\n > .${cell}:not(:last-child):not(.${cellFrozenLast}) {\n border-right: none;\n }\n`;\n\nexport const groupRowClassname = `rdg-group-row ${groupRow}`;\n\nconst groupRowSelected = css`\n &::after {\n content: '';\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n box-shadow: inset 0 0 0 2px var(--selection-color);\n pointer-events: none;\n z-index: 2;\n }\n\n > .${cell}:first-child {\n // preserve left border on the first frozen cell after scrolling to the right\n box-shadow: inset 2px 0 0 0 var(--selection-color);\n }\n`;\n\n// TODO: rename class\nexport const groupRowSelectedClassname = `rdg-group-row-selected ${groupRowSelected}`;\n","import { css } from '@linaria/core';\n\nconst headerRow = css`\n contain: strict;\n contain: size layout style paint;\n display: grid;\n grid-template-columns: var(--template-columns);\n grid-template-rows: var(--header-row-height);\n height: var(--header-row-height); // needed on Firefox\n line-height: var(--header-row-height);\n width: var(--row-width);\n position: sticky;\n top: 0;\n background-color: var(--header-background-color);\n font-weight: bold;\n z-index: 3;\n touch-action: none;\n`;\n\nexport const headerRowClassname = `rdg-header-row ${headerRow}`;\n","import { css } from '@linaria/core';\nimport { cell } from './cell';\n\nexport const row = css`\n contain: strict;\n contain: size layout style paint;\n display: grid;\n grid-template-rows: var(--row-height);\n grid-template-columns: var(--template-columns);\n position: absolute;\n left: 0;\n width: var(--row-width);\n height: var(--row-height); // needed on Firefox\n line-height: var(--row-height);\n background-color: var(--background-color);\n\n &:hover {\n background-color: var(--row-hover-background-color);\n }\n\n &[aria-selected='true'] {\n background-color: var(--row-selected-background-color);\n\n &:hover {\n background-color: var(--row-selected-hover-background-color);\n }\n }\n`;\n\nexport const rowClassname = `rdg-row ${row}`;\n\nconst summaryRow = css`\n position: sticky;\n z-index: 3;\n grid-template-rows: var(--summary-row-height);\n height: var(--summary-row-height); // needed on Firefox\n line-height: var(--summary-row-height);\n\n > .${cell} {\n border-top: 2px solid var(--summary-border-color);\n }\n`;\n\nexport const summaryRowClassname = `rdg-summary-row ${summaryRow}`;\n","import { useRef, useLayoutEffect } from 'react';\n\nexport function useFocusRef<T extends HTMLOrSVGElement>(isCellSelected: boolean) {\n const ref = useRef<T>(null);\n useLayoutEffect(() => {\n if (!isCellSelected) return;\n ref.current?.focus({ preventScroll: true });\n }, [isCellSelected]);\n\n return ref;\n}\n","import clsx from 'clsx';\nimport { css } from '@linaria/core';\nimport { useFocusRef } from '../hooks/useFocusRef';\n\nconst checkboxLabel = css`\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n margin-right: 1px; // align checkbox in row group cell\n`;\n\nconst checkboxLabelClassname = `rdg-checkbox-label ${checkboxLabel}`;\n\nconst checkboxInput = css`\n all: unset;\n width: 0;\n margin: 0;\n`;\n\nconst checkboxInputClassname = `rdg-checkbox-input ${checkboxInput}`;\n\nconst checkbox = css`\n content: '';\n width: 20px;\n height: 20px;\n border: 2px solid var(--border-color);\n background-color: var(--background-color);\n\n .${checkboxInput}:checked + & {\n background-color: var(--checkbox-color);\n box-shadow: inset 0px 0px 0px 4px var(--background-color);\n }\n\n .${checkboxInput}:focus + & {\n border-color: var(--checkbox-focus-color);\n }\n`;\n\nconst checkboxClassname = `rdg-checkbox ${checkbox}`;\n\nconst checkboxLabelDisabled = css`\n cursor: default;\n\n .${checkbox} {\n border-color: var(--checkbox-disabled-border-color);\n background-color: var(--checkbox-disabled-background-color);\n }\n`;\n\nconst checkboxLabelDisabledClassname = `rdg-checkbox-label-disabled ${checkboxLabelDisabled}`;\n\ntype SharedInputProps = Pick<\n React.InputHTMLAttributes<HTMLInputElement>,\n 'disabled' | 'tabIndex' | 'onClick' | 'aria-label' | 'aria-labelledby'\n>;\n\ninterface SelectCellFormatterProps extends SharedInputProps {\n isCellSelected: boolean;\n value: boolean;\n onChange: (value: boolean, isShiftClick: boolean) => void;\n}\n\nexport function SelectCellFormatter({\n value,\n tabIndex,\n isCellSelected,\n disabled,\n onClick,\n onChange,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy\n}: SelectCellFormatterProps) {\n const inputRef = useFocusRef<HTMLInputElement>(isCellSelected);\n\n function handleChange(e: React.ChangeEvent<HTMLInputElement>) {\n onChange(e.target.checked, (e.nativeEvent as MouseEvent).shiftKey);\n }\n\n return (\n <label className={clsx(checkboxLabelClassname, { [checkboxLabelDisabledClassname]: disabled })}>\n <input\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n tabIndex={tabIndex}\n ref={inputRef}\n type=\"checkbox\"\n className={checkboxInputClassname}\n disabled={disabled}\n checked={value}\n onChange={handleChange}\n onClick={onClick}\n />\n <div className={checkboxClassname} />\n </label>\n );\n}\n","import type { FormatterProps } from '../types';\n\nexport function ValueFormatter<R, SR>(props: FormatterProps<R, SR>) {\n try {\n return <>{props.row[props.column.key as keyof R]}</>;\n } catch {\n return null;\n }\n}\n","import { css } from '@linaria/core';\nimport type { GroupFormatterProps } from '../types';\nimport { useFocusRef } from '../hooks/useFocusRef';\n\nconst groupCellContent = css`\n outline: none;\n`;\n\nconst groupCellContentClassname = `rdg-group-cell-content ${groupCellContent}`;\n\nconst caret = css`\n margin-left: 4px;\n stroke: currentColor;\n stroke-width: 1.5px;\n fill: transparent;\n vertical-align: middle;\n\n > path {\n transition: d 0.1s;\n }\n`;\n\nconst caretClassname = `rdg-caret ${caret}`;\n\nexport function ToggleGroupFormatter<R, SR>({\n groupKey,\n isExpanded,\n isCellSelected,\n toggleGroup\n}: GroupFormatterProps<R, SR>) {\n const cellRef = useFocusRef<HTMLSpanElement>(isCellSelected);\n\n function handleKeyDown({ key }: React.KeyboardEvent<HTMLSpanElement>) {\n if (key === 'Enter') {\n toggleGroup();\n }\n }\n\n const d = isExpanded ? 'M1 1 L 7 7 L 13 1' : 'M1 7 L 7 1 L 13 7';\n\n return (\n <span\n ref={cellRef}\n className={groupCellContentClassname}\n tabIndex={-1}\n onKeyDown={handleKeyDown}\n >\n {groupKey}\n <svg viewBox=\"0 0 14 8\" width=\"14\" height=\"8\" className={caretClassname}>\n <path d={d} />\n </svg>\n </span>\n );\n}\n","import type { CalculatedColumn, ColSpanArgs } from '../types';\n\nexport function getColSpan<R, SR>(\n column: CalculatedColumn<R, SR>,\n lastFrozenColumnIndex: number,\n args: ColSpanArgs<R, SR>\n): number | undefined {\n const colSpan = typeof column.colSpan === 'function' ? column.colSpan(args) : 1;\n if (\n Number.isInteger(colSpan) &&\n colSpan! > 1 &&\n // ignore colSpan if it spans over both frozen and regular columns\n (!column.frozen || column.idx + colSpan! - 1 <= lastFrozenColumnIndex)\n ) {\n return colSpan!;\n }\n return undefined;\n}\n","export function stopPropagation(event: React.SyntheticEvent) {\n event.stopPropagation();\n}\n","// https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values\nconst nonInputKeys = new Set([\n // Special keys\n 'Unidentified',\n // Modifier keys\n 'Alt',\n 'AltGraph',\n 'CapsLock',\n 'Control',\n 'Fn',\n 'FnLock',\n 'Meta',\n 'NumLock',\n 'ScrollLock',\n 'Shift',\n // Whitespace keys\n 'Tab',\n // Navigation keys\n 'ArrowDown',\n 'ArrowLeft',\n 'ArrowRight',\n 'ArrowUp',\n 'End',\n 'Home',\n 'PageDown',\n 'PageUp',\n // Editing\n 'Insert',\n // UI keys\n 'ContextMenu',\n 'Escape',\n 'Pause',\n 'Play',\n // Device keys\n 'PrintScreen',\n // Function keys\n 'F1',\n // 'F2', /!\\ specifically allowed, do not edit\n 'F3',\n 'F4',\n 'F5',\n 'F6',\n 'F7',\n 'F8',\n 'F9',\n 'F10',\n 'F11',\n 'F12'\n]);\n\nexport function isCtrlKeyHeldDown(e: React.KeyboardEvent): boolean {\n return (e.ctrlKey || e.metaKey) && e.key !== 'Control';\n}\n\nexport function isDefaultCellInput(event: React.KeyboardEvent<HTMLDivElement>): boolean {\n return !nonInputKeys.has(event.key);\n}\n\n/**\n * By default, the following navigation keys are enabled while an editor is open, under specific conditions:\n * - Tab:\n * - The editor must be an <input>, a <textarea>, or a <select> element.\n * - The editor element must be the only immediate child of the editor container/a label.\n */\nexport function onEditorNavigation({ key, target }: React.KeyboardEvent<HTMLDivElement>): boolean {\n if (\n key === 'Tab' &&\n (target instanceof HTMLInputElement ||\n target instanceof HTMLTextAreaElement ||\n target instanceof HTMLSelectElement)\n ) {\n return target.matches(\n '.rdg-editor-container > :only-child, .rdg-editor-container > label:only-child > :only-child'\n );\n }\n return false;\n}\n","import type { CalculatedColumn, Position, GroupRow, CellNavigationMode } from '../types';\nimport { getColSpan } from './colSpanUtils';\n\ninterface IsSelectedCellEditableOpts<R, SR> {\n selectedPosition: Position;\n columns: readonly CalculatedColumn<R, SR>[];\n rows: readonly (R | GroupRow<R>)[];\n isGroupRow: (row: R | GroupRow<R>) => row is GroupRow<R>;\n}\n\nexport function isSelectedCellEditable<R, SR>({\n selectedPosition,\n columns,\n rows,\n isGroupRow\n}: IsSelectedCellEditableOpts<R, SR>): boolean {\n const column = columns[selectedPosition.idx];\n const row = rows[selectedPosition.rowIdx];\n return !isGroupRow(row) && isCellEditable(column, row);\n}\n\nexport function isCellEditable<R, SR>(column: CalculatedColumn<R, SR>, row: R): boolean {\n return (\n column.editor != null &&\n !column.rowGroup &&\n (typeof column.editable === 'function' ? column.editable(row) : column.editable) !== false\n );\n}\n\ninterface GetNextSelectedCellPositionOpts<R, SR> {\n cellNavigationMode: CellNavigationMode;\n columns: readonly CalculatedColumn<R, SR>[];\n colSpanColumns: readonly CalculatedColumn<R, SR>[];\n rows: readonly (R | GroupRow<R>)[];\n currentPosition: Readonly<Position>;\n nextPosition: Position;\n lastFrozenColumnIndex: number;\n isCellWithinBounds: (position: Position) => boolean;\n isGroupRow: (row: R | GroupRow<R>) => row is GroupRow<R>;\n}\n\nexport function getNextSelectedCellPosition<R, SR>({\n cellNavigationMode,\n columns,\n colSpanColumns,\n rows,\n currentPosition,\n nextPosition,\n lastFrozenColumnIndex,\n isCellWithinBounds,\n isGroupRow\n}: GetNextSelectedCellPositionOpts<R, SR>): Position {\n const rowsCount = rows.length;\n let position = nextPosition;\n\n const setColSpan = (moveRight: boolean) => {\n const row = rows[position.rowIdx];\n if (!isGroupRow(row)) {\n // If a cell within the colspan range is selected then move to the\n // previous or the next cell depending on the navigation direction\n const posIdx = position.idx;\n for (const column of colSpanColumns) {\n const colIdx = column.idx;\n if (colIdx > posIdx) break;\n const colSpan = getColSpan(column, lastFrozenColumnIndex, { type: 'ROW', row });\n if (colSpan && posIdx > colIdx && posIdx < colSpan + colIdx) {\n position.idx = colIdx + (moveRight ? colSpan : 0);\n break;\n }\n }\n }\n };\n\n if (isCellWithinBounds(position)) {\n setColSpan(position.idx - currentPosition.idx > 0);\n }\n\n if (cellNavigationMode !== 'NONE') {\n const { idx, rowIdx } = nextPosition;\n const columnsCount = columns.length;\n const isAfterLastColumn = idx === columnsCount;\n const isBeforeFirstColumn = idx === -1;\n\n if (isAfterLastColumn) {\n if (cellNavigationMode === 'CHANGE_ROW') {\n const isLastRow = rowIdx === rowsCount - 1;\n if (!isLastRow) {\n position = {\n idx: 0,\n rowIdx: rowIdx + 1\n };\n }\n } else {\n position = {\n rowIdx,\n idx: 0\n };\n }\n setColSpan(true);\n } else if (isBeforeFirstColumn) {\n if (cellNavigationMode === 'CHANGE_ROW') {\n const isFirstRow = rowIdx === 0;\n if (!isFirstRow) {\n position = {\n rowIdx: rowIdx - 1,\n idx: columnsCount - 1\n };\n }\n } else {\n position = {\n rowIdx,\n idx: columnsCount - 1\n };\n }\n }\n setColSpan(false);\n }\n\n return position;\n}\n\ninterface CanExitGridOpts<R, SR> {\n cellNavigationMode: CellNavigationMode;\n columns: readonly CalculatedColumn<R, SR>[];\n rowsCount: number;\n selectedPosition: Position;\n shiftKey: boolean;\n}\n\nexport function canExitGrid<R, SR>({\n cellNavigationMode,\n columns,\n rowsCount,\n selectedPosition: { rowIdx, idx },\n shiftKey\n}: CanExitGridOpts<R, SR>): boolean {\n // When the cellNavigationMode is 'none' or 'changeRow', you can exit the grid if you're at the first or last cell of the grid\n // When the cellNavigationMode is 'loopOverRow', there is no logical exit point so you can't exit the grid\n if (cellNavigationMode === 'NONE' || cellNavigationMode === 'CHANGE_ROW') {\n const atLastCellInRow = idx === columns.length - 1;\n const atFirstCellInRow = idx === 0;\n const atLastRow = rowIdx === rowsCount - 1;\n const atFirstRow = rowIdx === 0;\n\n return shiftKey ? atFirstCellInRow && atFirstRow : atLastCellInRow && atLastRow;\n }\n\n return false;\n}\n","import clsx from 'clsx';\n\nimport type { CalculatedColumn } from '../types';\nimport { cellClassname, cellFrozenClassname, cellFrozenLastClassname } from '../style';\n\nexport * from './colSpanUtils';\nexport * from './domUtils';\nexport * from './keyboardUtils';\nexport * from './selectedCellUtils';\n\nexport const { min, max, floor, ceil, sign } = Math;\n\nexport function assertIsValidKeyGetter<R, K extends React.Key>(\n keyGetter: unknown\n): asserts keyGetter is (row: R) => K {\n if (typeof keyGetter !== 'function') {\n throw new Error('Please specify the rowKeyGetter prop to use selection');\n }\n}\n\nexport function getCellStyle<R, SR>(\n column: CalculatedColumn<R, SR>,\n colSpan?: number\n): React.CSSProperties {\n return {\n gridColumnStart: column.idx + 1,\n gridColumnEnd: colSpan !== undefined ? `span ${colSpan}` : undefined,\n left: column.frozen ? `var(--frozen-left-${column.key})` : undefined\n };\n}\n\nexport function getCellClassname<R, SR>(\n column: CalculatedColumn<R, SR>,\n ...extraClasses: Parameters<typeof clsx>\n): string {\n return clsx(\n cellClassname,\n {\n [cellFrozenClassname]: column.frozen,\n [cellFrozenLastClassname]: column.isLastFrozenColumn\n },\n ...extraClasses\n );\n}\n","import { SelectCellFormatter } from './formatters';\nimport { useRowSelection } from './hooks';\nimport type { Column, FormatterProps, GroupFormatterProps } from './types';\nimport { stopPropagation } from './utils';\n\nexport const SELECT_COLUMN_KEY = 'select-row';\n\nfunction SelectFormatter(props: FormatterProps<unknown>) {\n const [isRowSelected, onRowSelectionChange] = useRowSelection();\n\n return (\n <SelectCellFormatter\n aria-label=\"Select\"\n tabIndex={-1}\n isCellSelected={props.isCellSelected}\n value={isRowSelected}\n onClick={stopPropagation}\n onChange={(checked, isShiftClick) => {\n onRowSelectionChange({ rowIdx: props.rowIdx, checked, isShiftClick });\n }}\n />\n );\n}\n\nfunction SelectGroupFormatter(props: GroupFormatterProps<unknown>) {\n const [isRowSelected, onRowSelectionChange] = useRowSelection();\n\n return (\n <SelectCellFormatter\n aria-label=\"Select Group\"\n tabIndex={-1}\n isCellSelected={props.isCellSelected}\n value={isRowSelected}\n onChange={(checked) => {\n onRowSelectionChange({ checked, isShiftClick: false, rowIdx: props.rowIdx });\n }}\n // Stop propagation to prevent row selection\n onClick={stopPropagation}\n />\n );\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const SelectColumn: Column<any, any> = {\n key: SELECT_COLUMN_KEY,\n name: '',\n width: 35,\n maxWidth: 35,\n resizable: false,\n sortable: false,\n frozen: true,\n headerRenderer(props) {\n return (\n <SelectCellFormatter\n aria-label=\"Select All\"\n isCellSelected={false}\n value={props.allRowsSelected}\n onChange={props.onAllRowsSelectionChange}\n />\n );\n },\n formatter: SelectFormatter,\n groupFormatter: SelectGroupFormatter\n};\n","import { useMemo } from 'react';\n\nimport type { CalculatedColumn, Column, ColumnMetric } from '../types';\nimport type { DataGridProps } from '../DataGrid';\nimport { ValueFormatter, ToggleGroupFormatter } from '../formatters';\nimport { SELECT_COLUMN_KEY } from '../Columns';\nimport { floor, max, min } from '../utils';\n\ninterface CalculatedColumnsArgs<R, SR> extends Pick<DataGridProps<R, SR>, 'defaultColumnOptions'> {\n rawColumns: readonly Column<R, SR>[];\n rawGroupBy: readonly string[] | undefined | null;\n viewportWidth: number;\n scrollLeft: number;\n columnWidths: ReadonlyMap<string, number>;\n enableVirtualization: boolean;\n}\n\nexport function useCalculatedColumns<R, SR>({\n rawColumns,\n columnWidths,\n viewportWidth,\n scrollLeft,\n defaultColumnOptions,\n rawGroupBy,\n enableVirtualization\n}: CalculatedColumnsArgs<R, SR>) {\n const minColumnWidth = defaultColumnOptions?.minWidth ?? 80;\n const defaultFormatter = defaultColumnOptions?.formatter ?? ValueFormatter;\n const defaultSortable = defaultColumnOptions?.sortable ?? false;\n const defaultResizable = defaultColumnOptions?.resizable ?? false;\n\n const { columns, colSpanColumns, lastFrozenColumnIndex, groupBy } = useMemo(() => {\n // Filter rawGroupBy and ignore keys that do not match the columns prop\n const groupBy: string[] = [];\n let lastFrozenColumnIndex = -1;\n\n const columns = rawColumns.map((rawColumn) => {\n const rowGroup = rawGroupBy?.includes(rawColumn.key) ?? false;\n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing\n const frozen = rowGroup || rawColumn.frozen || false;\n\n const column: CalculatedColumn<R, SR> = {\n ...rawColumn,\n idx: 0,\n frozen,\n isLastFrozenColumn: false,\n rowGroup,\n sortable: rawColumn.sortable ?? defaultSortable,\n resizable: rawColumn.resizable ?? defaultResizable,\n formatter: rawColumn.formatter ?? defaultFormatter\n };\n\n if (rowGroup) {\n column.groupFormatter ??= ToggleGroupFormatter;\n }\n\n if (frozen) {\n lastFrozenColumnIndex++;\n }\n\n return column;\n });\n\n columns.sort(({ key: aKey, frozen: frozenA }, { key: bKey, frozen: frozenB }) => {\n // Sort select column first:\n if (aKey === SELECT_COLUMN_KEY) return -1;\n if (bKey === SELECT_COLUMN_KEY) return 1;\n\n // Sort grouped columns second, following the groupBy order:\n if (rawGroupBy?.includes(aKey)) {\n if (rawGroupBy.includes(bKey)) {\n return rawGroupBy.indexOf(aKey) - rawGroupBy.indexOf(bKey);\n }\n return -1;\n }\n if (rawGroupBy?.includes(bKey)) return 1;\n\n // Sort frozen columns third:\n if (frozenA) {\n if (frozenB) return 0;\n return -1;\n }\n if (frozenB) return 1;\n\n // Sort other columns last:\n return 0;\n });\n\n const colSpanColumns: CalculatedColumn<R, SR>[] = [];\n columns.forEach((column, idx) => {\n column.idx = idx;\n\n if (column.rowGroup) {\n groupBy.push(column.key);\n }\n\n if (column.colSpan != null) {\n colSpanColumns.push(column);\n }\n });\n\n if (lastFrozenColumnIndex !== -1) {\n columns[lastFrozenColumnIndex].isLastFrozenColumn = true;\n }\n\n return {\n columns,\n colSpanColumns,\n lastFrozenColumnIndex,\n groupBy\n };\n }, [rawColumns, defaultFormatter, defaultResizable, defaultSortable, rawGroupBy]);\n\n const { layoutCssVars, totalColumnWidth, totalFrozenColumnWidth, columnMetrics } = useMemo(() => {\n const columnMetrics = new Map<CalculatedColumn<R, SR>, ColumnMetric>();\n let left = 0;\n let totalColumnWidth = 0;\n let totalFrozenColumnWidth = 0;\n let templateColumns = '';\n let allocatedWidth = 0;\n let unassignedColumnsCount = 0;\n\n for (const column of columns) {\n let width = getSpecifiedWidth(column, columnWidths, viewportWidth);\n\n if (width === undefined) {\n unassignedColumnsCount++;\n } else {\n width = clampColumnWidth(width, column, minColumnWidth);\n allocatedWidth += width;\n columnMetrics.set(column, { width, left: 0 });\n }\n }\n\n const unallocatedWidth = viewportWidth - allocatedWidth;\n const unallocatedColumnWidth = unallocatedWidth / unassignedColumnsCount;\n\n for (const column of columns) {\n let width: number;\n if (columnMetrics.has(column)) {\n const columnMetric = columnMetrics.get(column)!;\n columnMetric.left = left;\n ({ width } = columnMetric);\n } else {\n width = clampColumnWidth(unallocatedColumnWidth, column, minColumnWidth);\n columnMetrics.set(column, { width, left });\n }\n totalColumnWidth += width;\n left += width;\n templateColumns += `${width}px `;\n }\n\n if (lastFrozenColumnIndex !== -1) {\n const columnMetric = columnMetrics.get(columns[lastFrozenColumnIndex])!;\n totalFrozenColumnWidth = columnMetric.left + columnMetric.width;\n }\n\n const layoutCssVars: Record<string, string> = {\n '--template-columns': templateColumns\n };\n\n for (let i = 0; i <= lastFrozenColumnIndex; i++) {\n const column = columns[i];\n layoutCssVars[`--frozen-left-${column.key}`] = `${columnMetrics.get(column)!.left}px`;\n }\n\n return { layoutCssVars, totalColumnWidth, totalFrozenColumnWidth, columnMetrics };\n }, [columnWidths, columns, viewportWidth, minColumnWidth, lastFrozenColumnIndex]);\n\n const [colOverscanStartIdx, colOverscanEndIdx] = useMemo((): [number, number] => {\n if (!enableVirtualization) {\n return [0, columns.length - 1];\n }\n // get the viewport's left side and right side positions for non-frozen columns\n const viewportLeft = scrollLeft + totalFrozenColumnWidth;\n const viewportRight = scrollLeft + viewportWidth;\n // get first and last non-frozen column indexes\n const lastColIdx = columns.length - 1;\n const firstUnfrozenColumnIdx = min(lastFrozenColumnIndex + 1, lastColIdx);\n\n // skip rendering non-frozen columns if the frozen columns cover the entire viewport\n if (viewportLeft >= viewportRight) {\n return [firstUnfrozenColumnIdx, firstUnfrozenColumnIdx];\n }\n\n // get the first visible non-frozen column index\n let colVisibleStartIdx = firstUnfrozenColumnIdx;\n while (colVisibleStartIdx < lastColIdx) {\n const { left, width } = columnMetrics.get(columns[colVisibleStartIdx])!;\n // if the right side of the columnn is beyond the left side of the available viewport,\n // then it is the first column that's at least partially visible\n if (left + width > viewportLeft) {\n break;\n }\n colVisibleStartIdx++;\n }\n\n // get the last visible non-frozen column index\n let colVisibleEndIdx = colVisibleStartIdx;\n while (colVisibleEndIdx < lastColIdx) {\n const { left, width } = columnMetrics.get(columns[colVisibleEndIdx])!;\n // if the right side of the column is beyond or equal to the right side of the available viewport,\n // then it the last column that's at least partially visible, as the previous column's right side is not beyond the viewport.\n if (left + width >= viewportRight) {\n break;\n }\n colVisibleEndIdx++;\n }\n\n const colOverscanStartIdx = max(firstUnfrozenColumnIdx, colVisibleStartIdx - 1);\n const colOverscanEndIdx = min(lastColIdx, colVisibleEndIdx + 1);\n\n return [colOverscanStartIdx, colOverscanEndIdx];\n }, [\n columnMetrics,\n columns,\n lastFrozenColumnIndex,\n scrollLeft,\n totalFrozenColumnWidth,\n viewportWidth,\n enableVirtualization\n ]);\n\n return {\n columns,\n colSpanColumns,\n colOverscanStartIdx,\n colOverscanEndIdx,\n layoutCssVars,\n columnMetrics,\n totalColumnWidth,\n lastFrozenColumnIndex,\n totalFrozenColumnWidth,\n groupBy\n };\n}\n\nfunction getSpecifiedWidth<R, SR>(\n { key, width }: Column<R, SR>,\n columnWidths: ReadonlyMap<string, number>,\n viewportWidth: number\n): number | undefined {\n if (columnWidths.has(key)) {\n // Use the resized width if available\n return columnWidths.get(key);\n }\n if (typeof width === 'number') {\n return width;\n }\n if (typeof width === 'string' && /^\\d+%$/.test(width)) {\n return floor((viewportWidth * parseInt(width, 10)) / 100);\n }\n return undefined;\n}\n\nfunction clampColumnWidth<R, SR>(\n width: number,\n { minWidth, maxWidth }: Column<R, SR>,\n minColumnWidth: number\n): number {\n width = max(width, minWidth ?? minColumnWidth);\n\n if (typeof maxWidth === 'number') {\n return min(width, maxWidth);\n }\n\n return width;\n}\n","import { useRef, useState, useLayoutEffect } from 'react';\n\nexport function useGridDimensions(): [\n ref: React.RefObject<HTMLDivElement>,\n width: number,\n height: number\n] {\n const gridRef = useRef<HTMLDivElement>(null);\n const [gridWidth, setGridWidth] = useState(1);\n const [gridHeight, setGridHeight] = useState(1);\n\n useLayoutEffect(() => {\n const { ResizeObserver } = window;\n\n // don't break in jest/jsdom and browsers that don't support ResizeObserver\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n if (ResizeObserver == null) return;\n\n const resizeObserver = new ResizeObserver(() => {\n // Get dimensions without scrollbars.\n // The dimensions given by the callback entries in Firefox do not substract the scrollbar sizes.\n const { clientWidth, clientHeight } = gridRef.current!;\n // TODO: remove once fixed upstream\n // we reduce width by 1px here to avoid layout issues in Chrome\n // https://bugs.chromium.org/p/chromium/issues/detail?id=1206298\n setGridWidth(clientWidth - (devicePixelRatio % 0.5 === 0 ? 0 : 1));\n setGridHeight(clientHeight);\n });\n\n resizeObserver.observe(gridRef.current!);\n\n return () => {\n resizeObserver.disconnect();\n };\n }, []);\n\n return [gridRef, gridWidth, gridHeight];\n}\n","import { useRef, useEffect, useCallback } from 'react';\n\n// https://reactjs.org/docs/hooks-faq.html#what-can-i-do-if-my-effect-dependencies-change-too-often\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function useLatestFunc<T extends (...args: any[]) => any>(fn: T) {\n const ref = useRef(fn);\n\n useEffect(() => {\n ref.current = fn;\n });\n\n return useCallback((...args: Parameters<T>) => {\n ref.current(...args);\n }, []);\n}\n","import { createContext, useContext } from 'react';\nimport type { SelectRowEvent } from '../types';\n\nconst RowSelectionContext = createContext<boolean | undefined>(undefined);\n\nexport const RowSelectionProvider = RowSelectionContext.Provider;\n\nconst RowSelectionChangeContext =\n createContext<((selectRowEvent: SelectRowEvent) => void) | undefined>(undefined);\n\nexport const RowSelectionChangeProvider = RowSelectionChangeContext.Provider;\n\nexport function useRowSelection(): [boolean, (selectRowEvent: SelectRowEvent) => void] {\n const rowSelectionContext = useContext(RowSelectionContext);\n const rowSelectionChangeContext = useContext(RowSelectionChangeContext);\n\n if (rowSelectionContext === undefined || rowSelectionChangeContext === undefined) {\n throw new Error('useRowSelection must be used within DataGrid cells');\n }\n\n return [rowSelectionContext, rowSelectionChangeContext];\n}\n","import { useMemo } from 'react';\n\nimport { getColSpan } from '../utils';\nimport type { CalculatedColumn, GroupRow } from '../types';\n\ninterface ViewportColumnsArgs<R, SR> {\n columns: readonly CalculatedColumn<R, SR>[];\n colSpanColumns: readonly CalculatedColumn<R, SR>[];\n rows: readonly (R | GroupRow<R>)[];\n summaryRows: readonly SR[] | undefined | null;\n colOverscanStartIdx: number;\n colOverscanEndIdx: number;\n lastFrozenColumnIndex: number;\n rowOverscanStartIdx: number;\n rowOverscanEndIdx: number;\n isGroupRow: (row: R | GroupRow<R>) => row is GroupRow<R>;\n}\n\nexport function useViewportColumns<R, SR>({\n columns,\n colSpanColumns,\n rows,\n summaryRows,\n colOverscanStartIdx,\n colOverscanEndIdx,\n lastFrozenColumnIndex,\n rowOverscanStartIdx,\n rowOverscanEndIdx,\n isGroupRow\n}: ViewportColumnsArgs<R, SR>) {\n // find the column that spans over a column within the visible columns range and adjust colOverscanStartIdx\n const startIdx = useMemo(() => {\n if (colOverscanStartIdx === 0) return 0;\n\n let startIdx = colOverscanStartIdx;\n\n const updateStartIdx = (colIdx: number, colSpan: number | undefined) => {\n if (colSpan !== undefined && colIdx + colSpan > colOverscanStartIdx) {\n startIdx = colIdx;\n return true;\n }\n return false;\n };\n\n for (const column of colSpanColumns) {\n // check header row\n const colIdx = column.idx;\n if (colIdx >= startIdx) break;\n if (updateStartIdx(colIdx, getColSpan(column, lastFrozenColumnIndex, { type: 'HEADER' }))) {\n break;\n }\n\n // check viewport rows\n for (let rowIdx = rowOverscanStartIdx; rowIdx <= rowOverscanEndIdx; rowIdx++) {\n const row = rows[rowIdx];\n if (isGroupRow(row)) continue;\n if (\n updateStartIdx(colIdx, getColSpan(column, lastFrozenColumnIndex, { type: 'ROW', row }))\n ) {\n break;\n }\n }\n\n // check summary rows\n if (summaryRows != null) {\n for (const row of summaryRows) {\n if (\n updateStartIdx(\n colIdx,\n getColSpan(column, lastFrozenColumnIndex, { type: 'SUMMARY', row })\n )\n ) {\n break;\n }\n }\n }\n }\n\n return startIdx;\n }, [\n rowOverscanStartIdx,\n rowOverscanEndIdx,\n rows,\n summaryRows,\n colOverscanStartIdx,\n lastFrozenColumnIndex,\n colSpanColumns,\n isGroupRow\n ]);\n\n return useMemo((): readonly CalculatedColumn<R, SR>[] => {\n const viewportColumns: CalculatedColumn<R, SR>[] = [];\n for (let colIdx = 0; colIdx <= colOverscanEndIdx; colIdx++) {\n const column = columns[colIdx];\n\n if (colIdx < startIdx && !column.frozen) continue;\n viewportColumns.push(column);\n }\n\n return viewportColumns;\n }, [startIdx, colOverscanEndIdx, columns]);\n}\n","import { useMemo } from 'react';\nimport { ceil, floor, max, min } from '../utils';\nimport type { GroupRow, GroupByDictionary, RowHeightArgs } from '../types';\n\nconst RENDER_BATCH_SIZE = 8;\n\ninterface ViewportRowsArgs<R> {\n rawRows: readonly R[];\n rowHeight: number | ((args: RowHeightArgs<R>) => number);\n clientHeight: number;\n scrollTop: number;\n groupBy: readonly string[];\n rowGrouper:\n | ((rows: readonly R[], columnKey: string) => Record<string, readonly R[]>)\n | undefined\n | null;\n expandedGroupIds: ReadonlySet<unknown> | undefined | null;\n enableVirtualization: boolean;\n}\n\n// https://github.com/microsoft/TypeScript/issues/41808\nfunction isReadonlyArray(arr: unknown): arr is readonly unknown[] {\n return Array.isArray(arr);\n}\n\nexport function useViewportRows<R>({\n rawRows,\n rowHeight,\n clientHeight,\n scrollTop,\n groupBy,\n rowGrouper,\n expandedGroupIds,\n enableVirtualization\n}: ViewportRowsArgs<R>) {\n const [groupedRows, rowsCount] = useMemo(() => {\n if (groupBy.length === 0 || rowGrouper == null) return [undefined, rawRows.length];\n\n const groupRows = (\n rows: readonly R[],\n [groupByKey, ...remainingGroupByKeys]: readonly string[],\n startRowIndex: number\n ): [GroupByDictionary<R>, number] => {\n let groupRowsCount = 0;\n const groups: GroupByDictionary<R> = {};\n for (const [key, childRows] of Object.entries(rowGrouper(rows, groupByKey))) {\n // Recursively group each parent group\n const [childGroups, childRowsCount] =\n remainingGroupByKeys.length === 0\n ? [childRows, childRows.length]\n : groupRows(childRows, remainingGroupByKeys, startRowIndex + groupRowsCount + 1); // 1 for parent row\n groups[key] = { childRows, childGroups, startRowIndex: startRowIndex + groupRowsCount };\n groupRowsCount += childRowsCount + 1; // 1 for parent row\n }\n\n return [groups, groupRowsCount];\n };\n\n return groupRows(rawRows, groupBy, 0);\n }, [groupBy, rowGrouper, rawRows]);\n\n const [rows, isGroupRow] = useMemo(() => {\n const allGroupRows = new Set<unknown>();\n if (!groupedRows) return [rawRows, isGroupRow];\n\n const flattenedRows: Array<R | GroupRow<R>> = [];\n const expandGroup = (\n rows: GroupByDictionary<R> | readonly R[],\n parentId: string | undefined,\n level: number\n ): void => {\n if (isReadonlyArray(rows)) {\n flattenedRows.push(...rows);\n return;\n }\n Object.keys(rows).forEach((groupKey, posInSet, keys) => {\n // TODO: should users have control over the generated key?\n const id = parentId !== undefined ? `${parentId}__${groupKey}` : groupKey;\n const isExpanded = expandedGroupIds?.has(id) ?? false;\n const { childRows, childGroups, startRowIndex } = rows[groupKey];\n\n const groupRow: GroupRow<R> = {\n id,\n parentId,\n groupKey,\n isExpanded,\n childRows,\n level,\n posInSet,\n startRowIndex,\n setSize: keys.length\n };\n flattenedRows.push(groupRow);\n allGroupRows.add(groupRow);\n\n if (isExpanded) {\n expandGroup(childGroups, id, level + 1);\n }\n });\n };\n\n expandGroup(groupedRows, undefined, 0);\n return [flattenedRows, isGroupRow];\n\n function isGroupRow(row: R | GroupRow<R>): row is GroupRow<R> {\n return allGroupRows.has(row);\n }\n }, [expandedGroupIds, groupedRows, rawRows]);\n\n const { totalRowHeight, getRowTop, getRowHeight, findRowIdx } = useMemo(() => {\n if (typeof rowHeight === 'number') {\n return {\n totalRowHeight: rowHeight * rows.length,\n getRowTop: (rowIdx: number) => rowIdx * rowHeight,\n getRowHeight: () => rowHeight,\n findRowIdx: (offset: number) => floor(offset / rowHeight)\n };\n }\n\n let totalRowHeight = 0;\n // Calcule the height of all the rows upfront. This can cause performance issues\n // and we can consider using a similar approach as react-window\n // https://github.com/bvaughn/react-window/blob/master/src/VariableSizeList.js#L68\n const rowPositions = rows.map((row: R | GroupRow<R>) => {\n const currentRowHeight = isGroupRow(row)\n ? rowHeight({ type: 'GROUP', row })\n : rowHeight({ type: 'ROW', row });\n const position = { top: totalRowHeight, height: currentRowHeight };\n totalRowHeight += currentRowHeight;\n return position;\n });\n\n const validateRowIdx = (rowIdx: number) => {\n return max(0, min(rows.length - 1, rowIdx));\n };\n\n return {\n totalRowHeight,\n getRowTop: (rowIdx: number) => rowPositions[validateRowIdx(rowIdx)].top,\n getRowHeight: (rowIdx: number) => rowPositions[validateRowIdx(rowIdx)].height,\n findRowIdx(offset: number) {\n let start = 0;\n let end = rowPositions.length - 1;\n while (start <= end) {\n const middle = start + floor((end - start) / 2);\n const currentOffset = rowPositions[middle].top;\n\n if (currentOffset === offset) return middle;\n\n if (currentOffset < offset) {\n start = middle + 1;\n } else if (currentOffset > offset) {\n end = middle - 1;\n }\n\n if (start > end) return end;\n }\n return 0;\n }\n };\n }, [isGroupRow, rowHeight, rows]);\n\n if (!enableVirtualization) {\n return {\n rowOverscanStartIdx: 0,\n rowOverscanEndIdx: rows.length - 1,\n rows,\n rowsCount,\n totalRowHeight,\n isGroupRow,\n getRowTop,\n getRowHeight,\n findRowIdx\n };\n }\n\n const overscanThreshold = 4;\n const rowVisibleStartIdx = findRowIdx(scrollTop);\n const rowVisibleEndIdx = min(rows.length - 1, findRowIdx(scrollTop + clientHeight));\n const rowOverscanStartIdx = max(\n 0,\n floor((rowVisibleStartIdx - overscanThreshold) / RENDER_BATCH_SIZE) * RENDER_BATCH_SIZE\n );\n const rowOverscanEndIdx = min(\n rows.length - 1,\n ceil((rowVisibleEndIdx + overscanThreshold) / RENDER_BATCH_SIZE) * RENDER_BATCH_SIZE\n );\n\n return {\n rowOverscanStartIdx,\n rowOverscanEndIdx,\n rows,\n rowsCount,\n totalRowHeight,\n isGroupRow,\n getRowTop,\n getRowHeight,\n findRowIdx\n };\n}\n","import { css } from '@linaria/core';\nimport type { HeaderRendererProps } from '../types';\nconst headerSortCell = css`\n cursor: pointer;\n display: flex;\n`;\n\nconst headerSortCellClassname = `rdg-header-sort-cell ${headerSortCell}`;\n\nconst headerSortName = css`\n flex-grow: 1;\n overflow: hidden;\n overflow: clip;\n text-overflow: ellipsis;\n`;\n\nconst headerSortNameClassname = `rdg-header-sort-name ${headerSortName}`;\n\ntype SharedHeaderCellProps<R, SR> = Pick<\n HeaderRendererProps<R, SR>,\n 'sortDirection' | 'onSort' | 'priority'\n>;\ninterface Props<R, SR> extends SharedHeaderCellProps<R, SR> {\n children: React.ReactNode;\n}\n\nexport default function SortableHeaderCell<R, SR>({\n onSort,\n sortDirection,\n priority,\n children\n}: Props<R, SR>) {\n let sortText = '';\n if (sortDirection === 'ASC') {\n sortText = '\\u25B2';\n } else if (sortDirection === 'DESC') {\n sortText = '\\u25BC';\n }\n\n return (\n <span className={headerSortCellClassname} onClick={(e) => onSort(e.ctrlKey)}>\n <span className={headerSortNameClassname}>{children}</span>\n <span>\n {sortText}\n {priority}\n </span>\n </span>\n );\n}\n","import { css } from '@linaria/core';\n\nimport type { CalculatedColumn, SortColumn } from './types';\nimport type { HeaderRowProps } from './HeaderRow';\nimport SortableHeaderCell from './headerCells/SortableHeaderCell';\nimport { getCellStyle, getCellClassname } from './utils';\n\nconst cellResizable = css`\n &::after {\n content: '';\n cursor: col-resize;\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n width: 10px;\n }\n`;\n\nconst cellResizableClassname = `rdg-cell-resizable ${cellResizable}`;\n\ntype SharedHeaderRowProps<R, SR> = Pick<\n HeaderRowProps<R, SR, React.Key>,\n 'onSortColumnsChange' | 'allRowsSelected' | 'sortColumns'\n>;\n\nexport interface HeaderCellProps<R, SR> extends SharedHeaderRowProps<R, SR> {\n column: CalculatedColumn<R, SR>;\n colSpan: number | undefined;\n onResize: (column: CalculatedColumn<R, SR>, width: number) => void;\n onAllRowsSelectionChange: (checked: boolean) => void;\n}\n\nexport default function HeaderCell<R, SR>({\n column,\n colSpan,\n onResize,\n allRowsSelected,\n onAllRowsSelectionChange,\n sortColumns,\n onSortColumnsChange\n}: HeaderCellProps<R, SR>) {\n function onPointerDown(event: React.PointerEvent<HTMLDivElement>) {\n if (event.pointerType === 'mouse' && event.buttons !== 1) {\n return;\n }\n\n const { currentTarget, pointerId } = event;\n const { right } = currentTarget.getBoundingClientRect();\n const offset = right - event.clientX;\n\n if (offset > 11) {\n // +1px to account for the border size\n return;\n }\n\n function onPointerMove(event: PointerEvent) {\n if (event.pointerId !== pointerId) return;\n if (event.pointerType === 'mouse' && event.buttons !== 1) {\n onPointerUp(event);\n return;\n }\n const width = event.clientX + offset - currentTarget.getBoundingClientRect().left;\n if (width > 0) {\n onResize(column, width);\n }\n }\n\n function onPointerUp(event: PointerEvent) {\n if (event.pointerId !== pointerId) return;\n window.removeEventListener('pointermove', onPointerMove);\n window.removeEventListener('pointerup', onPointerUp);\n }\n\n event.preventDefault();\n window.addEventListener('pointermove', onPointerMove);\n window.addEventListener('pointerup', onPointerUp);\n }\n const sortIndex = sortColumns?.findIndex((sort) => sort.columnKey === column.key);\n const sortColumn =\n sortIndex !== undefined && sortIndex > -1 ? sortColumns![sortIndex] : undefined;\n const sortDirection = sortColumn?.direction;\n const priority = sortColumn !== undefined && sortColumns!.length > 1 ? sortIndex! + 1 : undefined;\n const ariaSort =\n sortDirection && !priority ? (sortDirection === 'ASC' ? 'ascending' : 'descending') : undefined;\n\n const onSort = (ctrlClick: boolean) => {\n if (onSortColumnsChange == null) return;\n const { sortDescendingFirst } = column;\n if (sortColumn === undefined) {\n // not currently sorted\n const nextSort: SortColumn = {\n columnKey: column.key,\n direction: sortDescendingFirst ? 'DESC' : 'ASC'\n };\n onSortColumnsChange(sortColumns && ctrlClick ? [...sortColumns, nextSort] : [nextSort]);\n } else {\n let nextSortColumn: SortColumn | undefined;\n if (\n (sortDescendingFirst && sortDirection === 'DESC') ||\n (!sortDescendingFirst && sortDirection === 'ASC')\n ) {\n nextSortColumn = {\n columnKey: column.key,\n direction: sortDirection === 'ASC' ? 'DESC' : 'ASC'\n };\n }\n if (ctrlClick) {\n const nextSortColumns = [...sortColumns!];\n if (nextSortColumn) {\n // swap direction\n nextSortColumns[sortIndex!] = nextSortColumn;\n } else {\n // remove sort\n nextSortColumns.splice(sortIndex!, 1);\n }\n onSortColumnsChange(nextSortColumns);\n } else {\n onSortColumnsChange(nextSortColumn ? [nextSortColumn] : []);\n }\n }\n };\n\n function getCell() {\n if (column.headerRenderer) {\n return (\n <column.headerRenderer\n column={column}\n sortDirection={sortDirection}\n priority={priority}\n onSort={onSort}\n allRowsSelected={allRowsSelected}\n onAllRowsSelectionChange={onAllRowsSelectionChange}\n />\n );\n }\n\n if (column.sortable) {\n return (\n <SortableHeaderCell onSort={onSort} sortDirection={sortDirection} priority={priority}>\n {column.name}\n </SortableHeaderCell>\n );\n }\n\n return column.name;\n }\n\n const className = getCellClassname(column, column.headerCellClass, {\n [cellResizableClassname]: column.resizable\n });\n\n return (\n <div\n role=\"columnheader\"\n aria-colindex={column.idx + 1}\n aria-sort={ariaSort}\n aria-colspan={colSpan}\n className={className}\n style={getCellStyle(column, colSpan)}\n onPointerDown={column.resizable ? onPointerDown : undefined}\n >\n {getCell()}\n </div>\n );\n}\n","import { useCallback, memo } from 'react';\n\nimport HeaderCell from './HeaderCell';\nimport type { CalculatedColumn } from './types';\nimport { assertIsValidKeyGetter, getColSpan } from './utils';\nimport type { DataGridProps } from './DataGrid';\nimport { headerRowClassname } from './style';\n\ntype SharedDataGridProps<R, SR, K extends React.Key> = Pick<\n DataGridProps<R, SR, K>,\n 'rows' | 'onSelectedRowsChange' | 'rowKeyGetter' | 'sortColumns' | 'onSortColumnsChange'\n>;\n\nexport interface HeaderRowProps<R, SR, K extends React.Key> extends SharedDataGridProps<R, SR, K> {\n columns: readonly CalculatedColumn<R, SR>[];\n allRowsSelected: boolean;\n onColumnResize: (column: CalculatedColumn<R, SR>, width: number) => void;\n lastFrozenColumnIndex: number;\n}\n\nfunction HeaderRow<R, SR, K extends React.Key>({\n columns,\n rows,\n rowKeyGetter,\n onSelectedRowsChange,\n allRowsSelected,\n onColumnResize,\n sortColumns,\n onSortColumnsChange,\n lastFrozenColumnIndex\n}: HeaderRowProps<R, SR, K>) {\n const handleAllRowsSelectionChange = useCallback(\n (checked: boolean) => {\n if (!onSelectedRowsChange) return;\n\n assertIsValidKeyGetter<R, K>(rowKeyGetter);\n\n const newSelectedRows = new Set<K>(checked ? rows.map(rowKeyGetter) : undefined);\n onSelectedRowsChange(newSelectedRows);\n },\n [onSelectedRowsChange, rows, rowKeyGetter]\n );\n\n const cells = [];\n for (let index = 0; index < columns.length; index++) {\n const column = columns[index];\n const colSpan = getColSpan(column, lastFrozenColumnIndex, { type: 'HEADER' });\n if (colSpan !== undefined) {\n index += colSpan - 1;\n }\n\n cells.push(\n <HeaderCell<R, SR>\n key={column.key}\n column={column}\n colSpan={colSpan}\n onResize={onColumnResize}\n allRowsSelected={allRowsSelected}\n onAllRowsSelectionChange={handleAllRowsSelectionChange}\n onSortColumnsChange={onSortColumnsChange}\n sortColumns={sortColumns}\n />\n );\n }\n\n return (\n <div\n role=\"row\"\n aria-rowindex={1} // aria-rowindex is 1 based\n className={headerRowClassname}\n >\n {cells}\n </div>\n );\n}\n\nexport default memo(HeaderRow) as <R, SR, K extends React.Key>(\n props: HeaderRowProps<R, SR, K>\n) => JSX.Element;\n","import { forwardRef, memo } from 'react';\nimport type { RefAttributes } from 'react';\nimport { css } from '@linaria/core';\n\nimport { getCellStyle, getCellClassname, isCellEditable } from './utils';\nimport type { CellRendererProps } from './types';\n\nconst cellCopied = css`\n background-color: #ccccff;\n`;\n\nconst cellCopiedClassname = `rdg-cell-copied ${cellCopied}`;\n\nconst cellDraggedOver = css`\n background-color: #ccccff;\n\n &.${cellCopied} {\n background-color: #9999ff;\n }\n`;\n\nconst cellDraggedOverClassname = `rdg-cell-dragged-over ${cellDraggedOver}`;\n\nconst cellDragHandle = css`\n cursor: move;\n position: absolute;\n right: 0;\n bottom: 0;\n width: 8px;\n height: 8px;\n background-color: var(--selection-color);\n\n &:hover {\n width: 16px;\n height: 16px;\n border: 2px solid var(--selection-color);\n background-color: var(--background-color);\n }\n`;\n\nconst cellDragHandleClassname = `rdg-cell-drag-handle ${cellDragHandle}`;\n\nfunction Cell<R, SR>(\n {\n className,\n column,\n colSpan,\n isCellSelected,\n isCopied,\n isDraggedOver,\n row,\n rowIdx,\n dragHandleProps,\n onRowClick,\n onClick,\n onDoubleClick,\n onContextMenu,\n onRowChange,\n selectCell,\n ...props\n }: CellRendererProps<R, SR>,\n ref: React.Ref<HTMLDivElement>\n) {\n const { cellClass } = column;\n className = getCellClassname(\n column,\n {\n [cellCopiedClassname]: isCopied,\n [cellDraggedOverClassname]: isDraggedOver\n },\n typeof cellClass === 'function' ? cellClass(row) : cellClass,\n className\n );\n\n function selectCellWrapper(openEditor?: boolean | null) {\n selectCell({ idx: column.idx, rowIdx }, openEditor);\n }\n\n function handleClick(event: React.MouseEvent<HTMLDivElement>) {\n selectCellWrapper(column.editorOptions?.editOnClick);\n onRowClick?.(rowIdx, row, column);\n onClick?.(event);\n }\n\n function handleContextMenu(event: React.MouseEvent<HTMLDivElement>) {\n selectCellWrapper();\n onContextMenu?.(event);\n }\n\n function handleDoubleClick(event: React.MouseEvent<HTMLDivElement>) {\n selectCellWrapper(true);\n onDoubleClick?.(event);\n }\n\n function handleRowChange(newRow: R) {\n onRowChange(rowIdx, newRow);\n }\n\n return (\n <div\n role=\"gridcell\"\n aria-colindex={column.idx + 1} // aria-colindex is 1-based\n aria-selected={isCellSelected}\n aria-colspan={colSpan}\n aria-readonly={!isCellEditable(column, row) || undefined}\n ref={ref}\n className={className}\n style={getCellStyle(column, colSpan)}\n onClick={handleClick}\n onDoubleClick={handleDoubleClick}\n onContextMenu={handleContextMenu}\n {...props}\n >\n {!column.rowGroup && (\n <>\n <column.formatter\n column={column}\n rowIdx={rowIdx}\n row={row}\n isCellSelected={isCellSelected}\n onRowChange={handleRowChange}\n />\n {dragHandleProps && <div className={cellDragHandleClassname} {...dragHandleProps} />}\n </>\n )}\n </div>\n );\n}\n\nexport default memo(forwardRef(Cell)) as <R, SR>(\n props: CellRendererProps<R, SR> & RefAttributes<HTMLDivElement>\n) => JSX.Element;\n","import { useEffect, useRef } from 'react';\nimport { createPortal } from 'react-dom';\nimport { css } from '@linaria/core';\n\nimport { useLatestFunc } from './hooks';\nimport { getCellStyle, getCellClassname } from './utils';\nimport type { CellRendererProps, EditorProps } from './types';\n\n/*\n * To check for outside `mousedown` events, we listen to all `mousedown` events at their birth,\n * i.e. on the window during the capture phase, and at their death, i.e. on the window during the bubble phase.\n *\n * We schedule a check at the birth of the event, cancel the check when the event reaches the \"inside\" container,\n * and trigger the \"outside\" callback when the event bubbles back up to the window.\n *\n * The event can be `stopPropagation()`ed halfway through, so they may not always bubble back up to the window,\n * so an alternative check must be used. The check must happen after the event can reach the \"inside\" container,\n * and not before it run to completion. `requestAnimationFrame` is the best way we know how to achieve this.\n * Usually we want click event handlers from parent components to access the latest commited values,\n * so `mousedown` is used instead of `click`.\n *\n * We must also rely on React's event capturing/bubbling to handle elements rendered in a portal.\n */\n\nconst cellEditing = css`\n padding: 0;\n`;\n\nconst cellEditingClassname = `rdg-editor-container ${cellEditing}`;\n\ntype SharedCellRendererProps<R, SR> = Pick<CellRendererProps<R, SR>, 'colSpan'>;\n\ninterface EditCellProps<R, SR> extends EditorProps<R, SR>, SharedCellRendererProps<R, SR> {\n onKeyDown: Required<React.HTMLAttributes<HTMLDivElement>>['onKeyDown'];\n}\n\nexport default function EditCell<R, SR>({\n column,\n colSpan,\n row,\n rowIdx,\n onRowChange,\n onClose,\n onKeyDown,\n editorPortalTarget\n}: EditCellProps<R, SR>) {\n const frameRequestRef = useRef<number | undefined>();\n\n // We need to prevent the `useEffect` from cleaning up between re-renders,\n // as `onWindowCaptureMouseDown` might otherwise miss valid mousedown events.\n // To that end we instead access the latest props via useLatestFunc.\n const commitOnOutsideMouseDown = useLatestFunc(() => {\n onRowChange(row, true);\n });\n\n function cancelFrameRequest() {\n cancelAnimationFrame(frameRequestRef.current!);\n }\n\n useEffect(() => {\n function onWindowCaptureMouseDown() {\n frameRequestRef.current = requestAnimationFrame(commitOnOutsideMouseDown);\n }\n\n addEventListener('mousedown', onWindowCaptureMouseDown, { capture: true });\n\n return () => {\n removeEventListener('mousedown', onWindowCaptureMouseDown, { capture: true });\n cancelFrameRequest();\n };\n }, [commitOnOutsideMouseDown]);\n\n const { cellClass } = column;\n const className = getCellClassname(\n column,\n cellEditingClassname,\n typeof cellClass === 'function' ? cellClass(row) : cellClass\n );\n\n let content;\n if (column.editor != null) {\n content = (\n <column.editor\n column={column}\n row={row}\n rowIdx={rowIdx}\n onRowChange={onRowChange}\n onClose={onClose}\n editorPortalTarget={editorPortalTarget}\n />\n );\n\n if (column.editorOptions?.createPortal) {\n content = createPortal(content, editorPortalTarget);\n }\n }\n\n return (\n <div\n role=\"gridcell\"\n aria-colindex={column.idx + 1} // aria-colindex is 1-based\n aria-selected\n className={className}\n style={getCellStyle(column, colSpan)}\n onKeyDown={onKeyDown}\n onMouseDownCapture={cancelFrameRequest}\n >\n {content}\n </div>\n );\n}\n","import { memo, forwardRef } from 'react';\nimport type { RefAttributes, CSSProperties } from 'react';\nimport clsx from 'clsx';\n\nimport { groupRowSelectedClassname, rowClassname } from './style';\nimport { getColSpan } from './utils';\nimport Cell from './Cell';\nimport EditCell from './EditCell';\nimport type { RowRendererProps, SelectedCellProps } from './types';\nimport { RowSelectionProvider } from './hooks';\n\nfunction Row<R, SR>(\n {\n cellRenderer,\n className,\n rowIdx,\n isRowSelected,\n copiedCellIdx,\n draggedOverCellIdx,\n lastFrozenColumnIndex,\n row,\n viewportColumns,\n selectedCellProps,\n onRowClick,\n rowClass,\n setDraggedOverRowIdx,\n onMouseEnter,\n top,\n height,\n onRowChange,\n selectCell,\n ...props\n }: RowRendererProps<R, SR>,\n ref: React.Ref<HTMLDivElement>\n) {\n function handleDragEnter(event: React.MouseEvent<HTMLDivElement>) {\n setDraggedOverRowIdx?.(rowIdx);\n onMouseEnter?.(event);\n }\n\n className = clsx(\n rowClassname,\n `rdg-row-${rowIdx % 2 === 0 ? 'even' : 'odd'}`,\n {\n [groupRowSelectedClassname]: selectedCellProps?.idx === -1\n },\n rowClass?.(row),\n className\n );\n\n const CellRenderer = cellRenderer ?? Cell;\n const cells = [];\n\n for (let index = 0; index < viewportColumns.length; index++) {\n const column = viewportColumns[index];\n const colSpan = getColSpan(column, lastFrozenColumnIndex, { type: 'ROW', row });\n if (colSpan !== undefined) {\n index += colSpan - 1;\n }\n\n const isCellSelected = selectedCellProps?.idx === column.idx;\n if (selectedCellProps?.mode === 'EDIT' && isCellSelected) {\n cells.push(\n <EditCell\n key={column.key}\n rowIdx={rowIdx}\n column={column}\n colSpan={colSpan}\n onKeyDown={selectedCellProps.onKeyDown}\n {...selectedCellProps.editorProps}\n />\n );\n continue;\n }\n\n cells.push(\n <CellRenderer\n key={column.key}\n rowIdx={rowIdx}\n column={column}\n colSpan={colSpan}\n row={row}\n isCopied={copiedCellIdx === column.idx}\n isDraggedOver={draggedOverCellIdx === column.idx}\n isCellSelected={isCellSelected}\n dragHandleProps={\n isCellSelected ? (selectedCellProps as SelectedCellProps).dragHandleProps : undefined\n }\n onFocus={isCellSelected ? (selectedCellProps as SelectedCellProps).onFocus : undefined}\n onKeyDown={isCellSelected ? selectedCellProps!.onKeyDown : undefined}\n onRowClick={onRowClick}\n onRowChange={onRowChange}\n selectCell={selectCell}\n />\n );\n }\n\n return (\n <RowSelectionProvider value={isRowSelected}>\n <div\n role=\"row\"\n ref={ref}\n className={className}\n onMouseEnter={handleDragEnter}\n style={\n {\n top,\n '--row-height': `${height}px`\n } as unknown as CSSProperties\n }\n {...props}\n >\n {cells}\n </div>\n </RowSelectionProvider>\n );\n}\n\nexport default memo(forwardRef(Row)) as <R, SR>(\n props: RowRendererProps<R, SR> & RefAttributes<HTMLDivElement>\n) => JSX.Element;\n","import { memo } from 'react';\n\nimport { getCellStyle, getCellClassname } from './utils';\nimport type { CalculatedColumn } from './types';\nimport type { GroupRowRendererProps } from './GroupRow';\n\ntype SharedGroupRowRendererProps<R, SR> = Pick<\n GroupRowRendererProps<R, SR>,\n 'id' | 'rowIdx' | 'groupKey' | 'childRows' | 'isExpanded' | 'toggleGroup'\n>;\n\ninterface GroupCellProps<R, SR> extends SharedGroupRowRendererProps<R, SR> {\n column: CalculatedColumn<R, SR>;\n isCellSelected: boolean;\n groupColumnIndex: number;\n}\n\nfunction GroupCell<R, SR>({\n id,\n rowIdx,\n groupKey,\n childRows,\n isExpanded,\n isCellSelected,\n column,\n groupColumnIndex,\n toggleGroup: toggleGroupWrapper\n}: GroupCellProps<R, SR>) {\n function toggleGroup() {\n toggleGroupWrapper(id);\n }\n\n // Only make the cell clickable if the group level matches\n const isLevelMatching = column.rowGroup && groupColumnIndex === column.idx;\n\n return (\n <div\n role=\"gridcell\"\n aria-colindex={column.idx + 1}\n key={column.key}\n className={getCellClassname(column)}\n style={{\n ...getCellStyle(column),\n cursor: isLevelMatching ? 'pointer' : 'default'\n }}\n onClick={isLevelMatching ? toggleGroup : undefined}\n >\n {(!column.rowGroup || groupColumnIndex === column.idx) && column.groupFormatter && (\n <column.groupFormatter\n rowIdx={rowIdx}\n groupKey={groupKey}\n childRows={childRows}\n column={column}\n isExpanded={isExpanded}\n isCellSelected={isCellSelected}\n toggleGroup={toggleGroup}\n />\n )}\n </div>\n );\n}\n\nexport default memo(GroupCell) as <R, SR>(props: GroupCellProps<R, SR>) => JSX.Element;\n","import type { CSSProperties } from 'react';\nimport { memo } from 'react';\nimport clsx from 'clsx';\n\nimport { groupRowClassname, groupRowSelectedClassname, rowClassname } from './style';\nimport { SELECT_COLUMN_KEY } from './Columns';\nimport GroupCell from './GroupCell';\nimport type { CalculatedColumn, Position, Omit } from './types';\nimport { RowSelectionProvider } from './hooks';\n\nexport interface GroupRowRendererProps<R, SR>\n extends Omit<React.HTMLAttributes<HTMLDivElement>, 'style' | 'children'> {\n id: string;\n groupKey: unknown;\n viewportColumns: readonly CalculatedColumn<R, SR>[];\n childRows: readonly R[];\n rowIdx: number;\n top: number;\n height: number;\n level: number;\n selectedCellIdx: number | undefined;\n isExpanded: boolean;\n isRowSelected: boolean;\n selectCell: (position: Position, enableEditor?: boolean) => void;\n toggleGroup: (expandedGroupId: unknown) => void;\n}\n\nfunction GroupedRow<R, SR>({\n id,\n groupKey,\n viewportColumns,\n childRows,\n rowIdx,\n top,\n height,\n level,\n isExpanded,\n selectedCellIdx,\n isRowSelected,\n selectCell,\n toggleGroup,\n ...props\n}: GroupRowRendererProps<R, SR>) {\n // Select is always the first column\n const idx = viewportColumns[0].key === SELECT_COLUMN_KEY ? level + 1 : level;\n\n function selectGroup() {\n selectCell({ rowIdx, idx: -1 });\n }\n\n return (\n <RowSelectionProvider value={isRowSelected}>\n <div\n role=\"row\"\n aria-level={level}\n aria-expanded={isExpanded}\n className={clsx(\n rowClassname,\n groupRowClassname,\n `rdg-row-${rowIdx % 2 === 0 ? 'even' : 'odd'}`,\n {\n [groupRowSelectedClassname]: selectedCellIdx === -1 // Select row if there is no selected cell\n }\n )}\n onClick={selectGroup}\n style={\n {\n top,\n '--row-height': `${height}px`\n } as unknown as CSSProperties\n }\n {...props}\n >\n {viewportColumns.map((column) => (\n <GroupCell\n key={column.key}\n id={id}\n rowIdx={rowIdx}\n groupKey={groupKey}\n childRows={childRows}\n isExpanded={isExpanded}\n isCellSelected={selectedCellIdx === column.idx}\n column={column}\n groupColumnIndex={idx}\n toggleGroup={toggleGroup}\n />\n ))}\n </div>\n </RowSelectionProvider>\n );\n}\n\nexport default memo(GroupedRow) as <R, SR>(props: GroupRowRendererProps<R, SR>) => JSX.Element;\n","import { memo } from 'react';\n\nimport { getCellStyle, getCellClassname } from './utils';\nimport type { CellRendererProps } from './types';\n\ntype SharedCellRendererProps<R, SR> = Pick<CellRendererProps<R, SR>, 'column' | 'colSpan'>;\n\ninterface SummaryCellProps<R, SR> extends SharedCellRendererProps<R, SR> {\n row: SR;\n}\n\nfunction SummaryCell<R, SR>({ column, colSpan, row }: SummaryCellProps<R, SR>) {\n const { summaryFormatter: SummaryFormatter, summaryCellClass } = column;\n const className = getCellClassname(\n column,\n typeof summaryCellClass === 'function' ? summaryCellClass(row) : summaryCellClass\n );\n\n return (\n <div\n role=\"gridcell\"\n aria-colindex={column.idx + 1}\n aria-colspan={colSpan}\n className={className}\n style={getCellStyle(column, colSpan)}\n >\n {SummaryFormatter && <SummaryFormatter column={column} row={row} />}\n </div>\n );\n}\n\nexport default memo(SummaryCell) as <R, SR>(props: SummaryCellProps<R, SR>) => JSX.Element;\n","import { memo } from 'react';\nimport { rowClassname, summaryRowClassname } from './style';\nimport { getColSpan } from './utils';\nimport SummaryCell from './SummaryCell';\nimport type { RowRendererProps } from './types';\n\ntype SharedRowRendererProps<R, SR> = Pick<RowRendererProps<R, SR>, 'viewportColumns' | 'rowIdx'>;\n\ninterface SummaryRowProps<R, SR> extends SharedRowRendererProps<R, SR> {\n 'aria-rowindex': number;\n row: SR;\n bottom: number;\n lastFrozenColumnIndex: number;\n}\n\nfunction SummaryRow<R, SR>({\n rowIdx,\n row,\n viewportColumns,\n bottom,\n lastFrozenColumnIndex,\n 'aria-rowindex': ariaRowIndex\n}: SummaryRowProps<R, SR>) {\n const cells = [];\n for (let index = 0; index < viewportColumns.length; index++) {\n const column = viewportColumns[index];\n const colSpan = getColSpan(column, lastFrozenColumnIndex, { type: 'SUMMARY', row });\n if (colSpan !== undefined) {\n index += colSpan - 1;\n }\n\n cells.push(<SummaryCell<R, SR> key={column.key} column={column} colSpan={colSpan} row={row} />);\n }\n\n return (\n <div\n role=\"row\"\n aria-rowindex={ariaRowIndex}\n className={`${rowClassname} rdg-row-${\n rowIdx % 2 === 0 ? 'even' : 'odd'\n } ${summaryRowClassname}`}\n style={{ bottom }}\n >\n {cells}\n </div>\n );\n}\n\nexport default memo(SummaryRow) as <R, SR>(props: SummaryRowProps<R, SR>) => JSX.Element;\n","import {\n forwardRef,\n useState,\n useRef,\n useLayoutEffect,\n useImperativeHandle,\n useCallback,\n useMemo\n} from 'react';\nimport type { Key, RefAttributes } from 'react';\nimport clsx from 'clsx';\n\nimport { rootClassname, viewportDraggingClassname, focusSinkClassname } from './style';\nimport {\n useGridDimensions,\n useCalculatedColumns,\n useViewportColumns,\n useViewportRows,\n useLatestFunc,\n RowSelectionChangeProvider\n} from './hooks';\nimport HeaderRow from './HeaderRow';\nimport Row from './Row';\nimport GroupRowRenderer from './GroupRow';\nimport SummaryRow from './SummaryRow';\nimport {\n assertIsValidKeyGetter,\n onEditorNavigation,\n getNextSelectedCellPosition,\n isSelectedCellEditable,\n canExitGrid,\n isCtrlKeyHeldDown,\n isDefaultCellInput,\n getColSpan,\n max,\n sign\n} from './utils';\n\nimport type {\n CalculatedColumn,\n Column,\n Position,\n RowRendererProps,\n RowsChangeData,\n SelectRowEvent,\n SelectedCellProps,\n EditCellProps,\n FillEvent,\n PasteEvent,\n CellNavigationMode,\n SortColumn,\n RowHeightArgs,\n SelectCellFn\n} from './types';\n\ninterface SelectCellState extends Position {\n mode: 'SELECT';\n}\n\ninterface EditCellState<R> extends Position {\n mode: 'EDIT';\n row: R;\n originalRow: R;\n key: string | null;\n}\n\ntype DefaultColumnOptions<R, SR> = Pick<\n Column<R, SR>,\n 'formatter' | 'minWidth' | 'resizable' | 'sortable'\n>;\n\n// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\nconst body = globalThis.document?.body;\n\nconst initialPosition: SelectCellState = {\n idx: -1,\n rowIdx: -1,\n mode: 'SELECT'\n};\n\nexport interface DataGridHandle {\n element: HTMLDivElement | null;\n scrollToColumn: (colIdx: number) => void;\n scrollToRow: (rowIdx: number) => void;\n selectCell: SelectCellFn;\n}\n\ntype SharedDivProps = Pick<\n React.HTMLAttributes<HTMLDivElement>,\n 'aria-label' | 'aria-labelledby' | 'aria-describedby' | 'className' | 'style'\n>;\n\nexport interface DataGridProps<R, SR = unknown, K extends Key = Key> extends SharedDivProps {\n /**\n * Grid and data Props\n */\n /** An array of objects representing each column on the grid */\n columns: readonly Column<R, SR>[];\n /** A function called for each rendered row that should return a plain key/value pair object */\n rows: readonly R[];\n /**\n * Rows to be pinned at the bottom of the rows view for summary, the vertical scroll bar will not scroll these rows.\n * Bottom horizontal scroll bar can move the row left / right. Or a customized row renderer can be used to disabled the scrolling support.\n */\n summaryRows?: readonly SR[] | null;\n /** The getter should return a unique key for each row */\n rowKeyGetter?: ((row: R) => K) | null;\n onRowsChange?: ((rows: R[], data: RowsChangeData<R, SR>) => void) | null;\n\n /**\n * Dimensions props\n */\n /** The height of each row in pixels */\n rowHeight?: number | ((args: RowHeightArgs<R>) => number) | null;\n /** The height of the header row in pixels */\n headerRowHeight?: number | null;\n /** The height of each summary row in pixels */\n summaryRowHeight?: number | null;\n\n /**\n * Feature props\n */\n /** Set of selected row keys */\n selectedRows?: ReadonlySet<K> | null;\n /** Function called whenever row selection is changed */\n onSelectedRowsChange?: ((selectedRows: Set<K>) => void) | null;\n /**Used for multi column sorting */\n sortColumns?: readonly Readonly<SortColumn>[] | null;\n onSortColumnsChange?: ((sortColumns: SortColumn[]) => void) | null;\n defaultColumnOptions?: DefaultColumnOptions<R, SR> | null;\n groupBy?: readonly string[] | null;\n rowGrouper?: ((rows: readonly R[], columnKey: string) => Record<string, readonly R[]>) | null;\n expandedGroupIds?: ReadonlySet<unknown> | null;\n onExpandedGroupIdsChange?: ((expandedGroupIds: Set<unknown>) => void) | null;\n onFill?: ((event: FillEvent<R>) => R[]) | null;\n onPaste?: ((event: PasteEvent<R>) => R) | null;\n\n /**\n * Custom renderers\n */\n rowRenderer?: React.ComponentType<RowRendererProps<R, SR>> | null;\n emptyRowsRenderer?: React.ComponentType | null;\n\n /**\n * Event props\n */\n /** Function called whenever a row is clicked */\n onRowClick?: ((rowIdx: number, row: R, column: CalculatedColumn<R, SR>) => void) | null;\n /** Called when the grid is scrolled */\n onScroll?: ((event: React.UIEvent<HTMLDivElement>) => void) | null;\n /** Called when a column is resized */\n onColumnResize?: ((idx: number, width: number) => void) | null;\n /** Function called whenever selected cell is changed */\n onSelectedCellChange?: ((position: Position) => void) | null;\n\n /**\n * Toggles and modes\n */\n cellNavigationMode?: CellNavigationMode | null;\n enableVirtualization?: boolean | null;\n\n /**\n * Miscellaneous\n */\n /** The node where the editor portal should mount. */\n editorPortalTarget?: Element | null;\n rowClass?: ((row: R) => string | undefined | null) | null;\n}\n\n/**\n * Main API Component to render a data grid of rows and columns\n *\n * @example\n *\n * <DataGrid columns={columns} rows={rows} />\n */\nfunction DataGrid<R, SR, K extends Key>(\n {\n // Grid and data Props\n columns: rawColumns,\n rows: rawRows,\n summaryRows,\n rowKeyGetter,\n onRowsChange,\n // Dimensions props\n rowHeight,\n headerRowHeight: rawHeaderRowHeight,\n summaryRowHeight: rawSummaryRowHeight,\n // Feature props\n selectedRows,\n onSelectedRowsChange,\n sortColumns,\n onSortColumnsChange,\n defaultColumnOptions,\n groupBy: rawGroupBy,\n rowGrouper,\n expandedGroupIds,\n onExpandedGroupIdsChange,\n // Custom renderers\n rowRenderer,\n emptyRowsRenderer: EmptyRowsRenderer,\n // Event props\n onRowClick,\n onScroll,\n onColumnResize,\n onSelectedCellChange,\n onFill,\n onPaste,\n // Toggles and modes\n cellNavigationMode: rawCellNavigationMode,\n enableVirtualization,\n // Miscellaneous\n editorPortalTarget: rawEditorPortalTarget,\n className,\n style,\n rowClass,\n // ARIA\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n 'aria-describedby': ariaDescribedBy\n }: DataGridProps<R, SR, K>,\n ref: React.Ref<DataGridHandle>\n) {\n /**\n * defaults\n */\n rowHeight ??= 35;\n const headerRowHeight = rawHeaderRowHeight ?? (typeof rowHeight === 'number' ? rowHeight : 35);\n const summaryRowHeight = rawSummaryRowHeight ?? (typeof rowHeight === 'number' ? rowHeight : 35);\n const RowRenderer = rowRenderer ?? Row;\n const cellNavigationMode = rawCellNavigationMode ?? 'NONE';\n enableVirtualization ??= true;\n const editorPortalTarget = rawEditorPortalTarget ?? body;\n\n /**\n * states\n */\n const [scrollTop, setScrollTop] = useState(0);\n const [scrollLeft, setScrollLeft] = useState(0);\n const [columnWidths, setColumnWidths] = useState<ReadonlyMap<string, number>>(() => new Map());\n const [selectedPosition, setSelectedPosition] =\n useState<SelectCellState | EditCellState<R>>(initialPosition);\n const [copiedCell, setCopiedCell] = useState<{ row: R; columnKey: string } | null>(null);\n const [isDragging, setDragging] = useState(false);\n const [draggedOverRowIdx, setOverRowIdx] = useState<number | undefined>(undefined);\n\n /**\n * refs\n */\n const focusSinkRef = useRef<HTMLDivElement>(null);\n const prevSelectedPosition = useRef(selectedPosition);\n const latestDraggedOverRowIdx = useRef(draggedOverRowIdx);\n const lastSelectedRowIdx = useRef(-1);\n const isCellFocusable = useRef(false);\n\n /**\n * The identity of the wrapper function is stable so it won't break memoization\n */\n const selectRowWrapper = useLatestFunc(selectRow);\n const selectCellWrapper = useLatestFunc(selectCell);\n const toggleGroupWrapper = useLatestFunc(toggleGroup);\n const handleFormatterRowChangeWrapper = useLatestFunc(updateRow);\n\n /**\n * computed values\n */\n const [gridRef, gridWidth, gridHeight] = useGridDimensions();\n const headerRowsCount = 1;\n const summaryRowsCount = summaryRows?.length ?? 0;\n const clientHeight = gridHeight - headerRowHeight - summaryRowsCount * summaryRowHeight;\n const isSelectable = selectedRows != null && onSelectedRowsChange != null;\n\n const allRowsSelected = useMemo((): boolean => {\n // no rows to select = explicitely unchecked\n const { length } = rawRows;\n return (\n length !== 0 &&\n selectedRows != null &&\n rowKeyGetter != null &&\n selectedRows.size >= length &&\n rawRows.every((row) => selectedRows.has(rowKeyGetter(row)))\n );\n }, [rawRows, selectedRows, rowKeyGetter]);\n\n const {\n columns,\n colSpanColumns,\n colOverscanStartIdx,\n colOverscanEndIdx,\n layoutCssVars,\n columnMetrics,\n totalColumnWidth,\n lastFrozenColumnIndex,\n totalFrozenColumnWidth,\n groupBy\n } = useCalculatedColumns({\n rawColumns,\n columnWidths,\n scrollLeft,\n viewportWidth: gridWidth,\n defaultColumnOptions,\n rawGroupBy: rowGrouper ? rawGroupBy : undefined,\n enableVirtualization\n });\n\n const {\n rowOverscanStartIdx,\n rowOverscanEndIdx,\n rows,\n rowsCount,\n totalRowHeight,\n isGroupRow,\n getRowTop,\n getRowHeight,\n findRowIdx\n } = useViewportRows({\n rawRows,\n groupBy,\n rowGrouper,\n rowHeight,\n clientHeight,\n scrollTop,\n expandedGroupIds,\n enableVirtualization\n });\n\n const viewportColumns = useViewportColumns({\n columns,\n colSpanColumns,\n colOverscanStartIdx,\n colOverscanEndIdx,\n lastFrozenColumnIndex,\n rowOverscanStartIdx,\n rowOverscanEndIdx,\n rows,\n summaryRows,\n isGroupRow\n });\n\n const hasGroups = groupBy.length > 0 && typeof rowGrouper === 'function';\n const minColIdx = hasGroups ? -1 : 0;\n\n // Cell drag is not supported on a treegrid\n const enableCellDragAndDrop = hasGroups ? false : onFill != null;\n\n /**\n * effects\n */\n useLayoutEffect(() => {\n if (\n selectedPosition === prevSelectedPosition.current ||\n selectedPosition.mode === 'EDIT' ||\n !isCellWithinBounds(selectedPosition)\n ) {\n return;\n }\n prevSelectedPosition.current = selectedPosition;\n scrollToCell(selectedPosition);\n\n if (isCellFocusable.current) {\n isCellFocusable.current = false;\n return;\n }\n focusSinkRef.current!.focus({ preventScroll: true });\n });\n\n useImperativeHandle(ref, () => ({\n element: gridRef.current,\n scrollToColumn(idx: number) {\n scrollToCell({ idx });\n },\n scrollToRow(rowIdx: number) {\n const { current } = gridRef;\n if (!current) return;\n current.scrollTo({\n top: getRowTop(rowIdx),\n behavior: 'smooth'\n });\n },\n selectCell\n }));\n\n /**\n * callbacks\n */\n const handleColumnResize = useCallback(\n (column: CalculatedColumn<R, SR>, width: number) => {\n setColumnWidths((columnWidths) => {\n const newColumnWidths = new Map(columnWidths);\n newColumnWidths.set(column.key, width);\n return newColumnWidths;\n });\n\n onColumnResize?.(column.idx, width);\n },\n [onColumnResize]\n );\n\n const setDraggedOverRowIdx = useCallback((rowIdx?: number) => {\n setOverRowIdx(rowIdx);\n latestDraggedOverRowIdx.current = rowIdx;\n }, []);\n\n /**\n * event handlers\n */\n function selectRow({ rowIdx, checked, isShiftClick }: SelectRowEvent) {\n if (!onSelectedRowsChange) return;\n\n assertIsValidKeyGetter<R, K>(rowKeyGetter);\n const newSelectedRows = new Set(selectedRows);\n const row = rows[rowIdx];\n if (isGroupRow(row)) {\n for (const childRow of row.childRows) {\n const rowKey = rowKeyGetter(childRow);\n if (checked) {\n newSelectedRows.add(rowKey);\n } else {\n newSelectedRows.delete(rowKey);\n }\n }\n onSelectedRowsChange(newSelectedRows);\n return;\n }\n\n const rowKey = rowKeyGetter(row);\n if (checked) {\n newSelectedRows.add(rowKey);\n const previousRowIdx = lastSelectedRowIdx.current;\n lastSelectedRowIdx.current = rowIdx;\n if (isShiftClick && previousRowIdx !== -1 && previousRowIdx !== rowIdx) {\n const step = sign(rowIdx - previousRowIdx);\n for (let i = previousRowIdx + step; i !== rowIdx; i += step) {\n const row = rows[i];\n if (isGroupRow(row)) continue;\n newSelectedRows.add(rowKeyGetter(row));\n }\n }\n } else {\n newSelectedRows.delete(rowKey);\n lastSelectedRowIdx.current = -1;\n }\n\n onSelectedRowsChange(newSelectedRows);\n }\n\n function toggleGroup(expandedGroupId: unknown) {\n if (!onExpandedGroupIdsChange) return;\n const newExpandedGroupIds = new Set(expandedGroupIds);\n if (newExpandedGroupIds.has(expandedGroupId)) {\n newExpandedGroupIds.delete(expandedGroupId);\n } else {\n newExpandedGroupIds.add(expandedGroupId);\n }\n onExpandedGroupIdsChange(newExpandedGroupIds);\n }\n\n function onGridFocus() {\n if (!isCellWithinBounds(selectedPosition)) {\n // Tabbing into the grid should initiate keyboard navigation\n const initialPosition: SelectCellState = { idx: 0, rowIdx: 0, mode: 'SELECT' };\n if (isCellWithinBounds(initialPosition)) {\n setSelectedPosition(initialPosition);\n }\n } else {\n // otherwise if we already have a selected cell, we should scroll back to it when focusing the grid\n scrollToCell(selectedPosition);\n }\n }\n\n function handleKeyDown(event: React.KeyboardEvent<HTMLDivElement>) {\n const { key, keyCode } = event;\n const row = rows[selectedPosition.rowIdx];\n\n if (\n onPaste &&\n isCtrlKeyHeldDown(event) &&\n isCellWithinBounds(selectedPosition) &&\n !isGroupRow(row) &&\n selectedPosition.idx !== -1 &&\n selectedPosition.mode === 'SELECT'\n ) {\n // event.key may differ by keyboard input language, so we use event.keyCode instead\n // event.nativeEvent.code cannot be used either as it would break copy/paste for the DVORAK layout\n const cKey = 67;\n const vKey = 86;\n if (keyCode === cKey) {\n handleCopy();\n return;\n }\n if (keyCode === vKey) {\n handlePaste();\n return;\n }\n }\n\n if (\n isCellWithinBounds(selectedPosition) &&\n isGroupRow(row) &&\n selectedPosition.idx === -1 &&\n // Collapse the current group row if it is focused and is in expanded state\n ((key === 'ArrowLeft' && row.isExpanded) ||\n // Expand the current group row if it is focused and is in collapsed state\n (key === 'ArrowRight' && !row.isExpanded))\n ) {\n event.preventDefault(); // Prevents scrolling\n toggleGroup(row.id);\n return;\n }\n\n switch (event.key) {\n case 'Escape':\n setCopiedCell(null);\n closeEditor();\n return;\n case 'ArrowUp':\n case 'ArrowDown':\n case 'ArrowLeft':\n case 'ArrowRight':\n case 'Tab':\n case 'Home':\n case 'End':\n case 'PageUp':\n case 'PageDown':\n navigate(event);\n break;\n default:\n handleCellInput(event);\n break;\n }\n }\n\n function handleFocus() {\n isCellFocusable.current = true;\n }\n\n function handleScroll(event: React.UIEvent<HTMLDivElement>) {\n const { scrollTop, scrollLeft } = event.currentTarget;\n setScrollTop(scrollTop);\n setScrollLeft(scrollLeft);\n onScroll?.(event);\n }\n\n function getRawRowIdx(rowIdx: number) {\n return hasGroups ? rawRows.indexOf(rows[rowIdx] as R) : rowIdx;\n }\n\n function updateRow(rowIdx: number, row: R) {\n if (typeof onRowsChange !== 'function') return;\n if (row === rawRows[rowIdx]) return;\n const updatedRows = [...rawRows];\n updatedRows[rowIdx] = row;\n onRowsChange(updatedRows, {\n indexes: [rowIdx],\n column: columns[selectedPosition.idx]\n });\n }\n\n function commitEditorChanges() {\n if (\n columns[selectedPosition.idx]?.editor == null ||\n selectedPosition.mode === 'SELECT' ||\n selectedPosition.row === selectedPosition.originalRow\n ) {\n return;\n }\n\n const rowIdx = getRawRowIdx(selectedPosition.rowIdx);\n updateRow(rowIdx, selectedPosition.row);\n }\n\n function handleCopy() {\n const { idx, rowIdx } = selectedPosition;\n setCopiedCell({ row: rawRows[getRawRowIdx(rowIdx)], columnKey: columns[idx].key });\n }\n\n function handlePaste() {\n const { idx, rowIdx } = selectedPosition;\n const targetRow = rawRows[getRawRowIdx(rowIdx)];\n if (!onPaste || !onRowsChange || copiedCell === null || !isCellEditable(selectedPosition)) {\n return;\n }\n\n const updatedTargetRow = onPaste({\n sourceRow: copiedCell.row,\n sourceColumnKey: copiedCell.columnKey,\n targetRow,\n targetColumnKey: columns[idx].key\n });\n\n updateRow(rowIdx, updatedTargetRow);\n }\n\n function handleCellInput(event: React.KeyboardEvent<HTMLDivElement>) {\n if (!isCellWithinBounds(selectedPosition)) return;\n const row = rows[selectedPosition.rowIdx];\n if (isGroupRow(row)) return;\n const { key } = event;\n const column = columns[selectedPosition.idx];\n\n if (selectedPosition.mode === 'EDIT') {\n if (key === 'Enter') {\n // Custom editors can listen for the event and stop propagation to prevent commit\n commitEditorChanges();\n closeEditor();\n }\n return;\n }\n\n column.editorOptions?.onCellKeyDown?.(event);\n if (event.isDefaultPrevented()) return;\n\n if (isCellEditable(selectedPosition) && isDefaultCellInput(event)) {\n setSelectedPosition(({ idx, rowIdx }) => ({\n idx,\n rowIdx,\n key,\n mode: 'EDIT',\n row,\n originalRow: row\n }));\n }\n }\n\n function handleDragEnd() {\n const overRowIdx = latestDraggedOverRowIdx.current;\n if (overRowIdx === undefined || !onFill || !onRowsChange) return;\n\n const { idx, rowIdx } = selectedPosition;\n const sourceRow = rawRows[rowIdx];\n const startRowIndex = rowIdx < overRowIdx ? rowIdx + 1 : overRowIdx;\n const endRowIndex = rowIdx < overRowIdx ? overRowIdx + 1 : rowIdx;\n const targetRows = rawRows.slice(startRowIndex, endRowIndex);\n const column = columns[idx];\n const updatedTargetRows = onFill({ columnKey: column.key, sourceRow, targetRows });\n const updatedRows = [...rawRows];\n const indexes: number[] = [];\n\n for (let i = startRowIndex; i < endRowIndex; i++) {\n const targetRowIdx = i - startRowIndex;\n if (updatedRows[i] !== updatedTargetRows[targetRowIdx]) {\n updatedRows[i] = updatedTargetRows[targetRowIdx];\n indexes.push(i);\n }\n }\n\n if (indexes.length > 0) {\n onRowsChange(updatedRows, { indexes, column });\n }\n setDraggedOverRowIdx(undefined);\n }\n\n function handleMouseDown(event: React.MouseEvent<HTMLDivElement, MouseEvent>) {\n if (event.buttons !== 1) return;\n setDragging(true);\n window.addEventListener('mouseover', onMouseOver);\n window.addEventListener('mouseup', onMouseUp);\n\n function onMouseOver(event: MouseEvent) {\n // Trigger onMouseup in edge cases where we release the mouse button but `mouseup` isn't triggered,\n // for example when releasing the mouse button outside the iframe the grid is rendered in.\n // https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/buttons\n if (event.buttons !== 1) onMouseUp();\n }\n\n function onMouseUp() {\n window.removeEventListener('mouseover', onMouseOver);\n window.removeEventListener('mouseup', onMouseUp);\n setDragging(false);\n handleDragEnd();\n }\n }\n\n function handleDoubleClick(event: React.MouseEvent<HTMLDivElement>) {\n event.stopPropagation();\n if (!onFill || !onRowsChange) return;\n\n const { idx, rowIdx } = selectedPosition;\n const sourceRow = rawRows[rowIdx];\n const targetRows = rawRows.slice(rowIdx + 1);\n const column = columns[idx];\n const updatedTargetRows = onFill({ columnKey: column.key, sourceRow, targetRows });\n const updatedRows = [...rawRows];\n const indexes: number[] = [];\n\n for (let i = rowIdx + 1; i < updatedRows.length; i++) {\n const targetRowIdx = i - rowIdx - 1;\n if (updatedRows[i] !== updatedTargetRows[targetRowIdx]) {\n updatedRows[i] = updatedTargetRows[targetRowIdx];\n indexes.push(i);\n }\n }\n\n if (indexes.length > 0) {\n onRowsChange(updatedRows, { indexes, column });\n }\n }\n\n function handleEditorRowChange(row: Readonly<R>, commitChanges?: boolean) {\n if (selectedPosition.mode === 'SELECT') return;\n if (commitChanges) {\n updateRow(getRawRowIdx(selectedPosition.rowIdx), row);\n closeEditor();\n } else {\n setSelectedPosition((position) => ({ ...position, row }));\n }\n }\n\n function handleOnClose(commitChanges?: boolean) {\n if (commitChanges) {\n commitEditorChanges();\n }\n closeEditor();\n }\n\n /**\n * utils\n */\n function isCellWithinBounds({ idx, rowIdx }: Position): boolean {\n return rowIdx >= 0 && rowIdx < rows.length && idx >= minColIdx && idx < columns.length;\n }\n\n function isCellEditable(position: Position): boolean {\n return (\n isCellWithinBounds(position) &&\n isSelectedCellEditable({ columns, rows, selectedPosition: position, isGroupRow })\n );\n }\n\n function selectCell(position: Position, enableEditor?: boolean | null): void {\n if (!isCellWithinBounds(position)) return;\n commitEditorChanges();\n\n if (enableEditor && isCellEditable(position)) {\n const row = rows[position.rowIdx] as R;\n setSelectedPosition({ ...position, mode: 'EDIT', key: null, row, originalRow: row });\n } else {\n setSelectedPosition({ ...position, mode: 'SELECT' });\n }\n onSelectedCellChange?.({ ...position });\n }\n\n function closeEditor() {\n if (selectedPosition.mode === 'SELECT') return;\n setSelectedPosition(({ idx, rowIdx }) => ({ idx, rowIdx, mode: 'SELECT' }));\n }\n\n function scrollToCell({ idx, rowIdx }: Partial<Position>): void {\n const { current } = gridRef;\n if (!current) return;\n\n if (typeof idx === 'number' && idx > lastFrozenColumnIndex) {\n rowIdx ??= selectedPosition.rowIdx;\n if (!isCellWithinBounds({ rowIdx, idx })) return;\n const { clientWidth } = current;\n const column = columns[idx];\n const { left, width } = columnMetrics.get(column)!;\n let right = left + width;\n const row = rows[rowIdx];\n if (!isGroupRow(row)) {\n const colSpan = getColSpan(column, lastFrozenColumnIndex, { type: 'ROW', row });\n if (colSpan !== undefined) {\n const { left, width } = columnMetrics.get(columns[column.idx + colSpan - 1])!;\n right = left + width;\n }\n }\n\n const isCellAtLeftBoundary = left < scrollLeft + totalFrozenColumnWidth;\n const isCellAtRightBoundary = right > clientWidth + scrollLeft;\n if (isCellAtLeftBoundary) {\n current.scrollLeft = left - totalFrozenColumnWidth;\n } else if (isCellAtRightBoundary) {\n current.scrollLeft = right - clientWidth;\n }\n }\n\n if (typeof rowIdx === 'number') {\n const rowTop = getRowTop(rowIdx);\n const rowHeight = getRowHeight(rowIdx);\n if (rowTop < scrollTop) {\n // at top boundary, scroll to the row's top\n current.scrollTop = rowTop;\n } else if (rowTop + rowHeight > scrollTop + clientHeight) {\n // at bottom boundary, scroll the next row's top to the bottom of the viewport\n current.scrollTop = rowTop + rowHeight - clientHeight;\n }\n }\n }\n\n function getNextPosition(key: string, ctrlKey: boolean, shiftKey: boolean): Position {\n const { idx, rowIdx } = selectedPosition;\n const row = rows[rowIdx];\n const isRowSelected = isCellWithinBounds(selectedPosition) && idx === -1;\n\n // If a group row is focused, and it is collapsed, move to the parent group row (if there is one).\n if (\n key === 'ArrowLeft' &&\n isRowSelected &&\n isGroupRow(row) &&\n !row.isExpanded &&\n row.level !== 0\n ) {\n let parentRowIdx = -1;\n for (let i = selectedPosition.rowIdx - 1; i >= 0; i--) {\n const parentRow = rows[i];\n if (isGroupRow(parentRow) && parentRow.id === row.parentId) {\n parentRowIdx = i;\n break;\n }\n }\n if (parentRowIdx !== -1) {\n return { idx, rowIdx: parentRowIdx };\n }\n }\n\n switch (key) {\n case 'ArrowUp':\n return { idx, rowIdx: rowIdx - 1 };\n case 'ArrowDown':\n return { idx, rowIdx: rowIdx + 1 };\n case 'ArrowLeft':\n return { idx: idx - 1, rowIdx };\n case 'ArrowRight':\n return { idx: idx + 1, rowIdx };\n case 'Tab':\n if (selectedPosition.idx === -1 && selectedPosition.rowIdx === -1) {\n return shiftKey\n ? { idx: columns.length - 1, rowIdx: rows.length - 1 }\n : { idx: 0, rowIdx: 0 };\n }\n return { idx: idx + (shiftKey ? -1 : 1), rowIdx };\n case 'Home':\n // If row is selected then move focus to the first row\n if (isRowSelected) return { idx, rowIdx: 0 };\n return ctrlKey ? { idx: 0, rowIdx: 0 } : { idx: 0, rowIdx };\n case 'End':\n // If row is selected then move focus to the last row.\n if (isRowSelected) return { idx, rowIdx: rows.length - 1 };\n return ctrlKey\n ? { idx: columns.length - 1, rowIdx: rows.length - 1 }\n : { idx: columns.length - 1, rowIdx };\n case 'PageUp': {\n const nextRowY = getRowTop(rowIdx) + getRowHeight(rowIdx) - clientHeight;\n return { idx, rowIdx: nextRowY > 0 ? findRowIdx(nextRowY) : 0 };\n }\n case 'PageDown': {\n const nextRowY = getRowTop(rowIdx) + clientHeight;\n return { idx, rowIdx: nextRowY < totalRowHeight ? findRowIdx(nextRowY) : rows.length - 1 };\n }\n default:\n return selectedPosition;\n }\n }\n\n function navigate(event: React.KeyboardEvent<HTMLDivElement>) {\n if (selectedPosition.mode === 'EDIT') {\n const onNavigation =\n columns[selectedPosition.idx].editorOptions?.onNavigation ?? onEditorNavigation;\n if (!onNavigation(event)) return;\n }\n const { key, shiftKey } = event;\n let mode = cellNavigationMode;\n if (key === 'Tab') {\n // If we are in a position to leave the grid, stop editing but stay in that cell\n if (\n canExitGrid({\n shiftKey,\n cellNavigationMode,\n columns,\n rowsCount: rows.length,\n selectedPosition\n })\n ) {\n commitEditorChanges();\n // Allow focus to leave the grid so the next control in the tab order can be focused\n return;\n }\n\n mode = cellNavigationMode === 'NONE' ? 'CHANGE_ROW' : cellNavigationMode;\n }\n\n // Do not allow focus to leave\n event.preventDefault();\n\n const ctrlKey = isCtrlKeyHeldDown(event);\n const nextPosition = getNextSelectedCellPosition({\n columns,\n colSpanColumns,\n rows,\n lastFrozenColumnIndex,\n cellNavigationMode: mode,\n currentPosition: selectedPosition,\n nextPosition: getNextPosition(key, ctrlKey, shiftKey),\n isCellWithinBounds,\n isGroupRow\n });\n\n selectCell(nextPosition);\n }\n\n function getDraggedOverCellIdx(currentRowIdx: number): number | undefined {\n if (draggedOverRowIdx === undefined) return;\n const { rowIdx } = selectedPosition;\n\n const isDraggedOver =\n rowIdx < draggedOverRowIdx\n ? rowIdx < currentRowIdx && currentRowIdx <= draggedOverRowIdx\n : rowIdx > currentRowIdx && currentRowIdx >= draggedOverRowIdx;\n\n return isDraggedOver ? selectedPosition.idx : undefined;\n }\n\n function getSelectedCellProps(rowIdx: number): SelectedCellProps | EditCellProps<R> | undefined {\n if (selectedPosition.rowIdx !== rowIdx) return;\n\n if (selectedPosition.mode === 'EDIT') {\n return {\n mode: 'EDIT',\n idx: selectedPosition.idx,\n onKeyDown: handleKeyDown,\n editorProps: {\n editorPortalTarget,\n row: selectedPosition.row,\n onRowChange: handleEditorRowChange,\n onClose: handleOnClose\n }\n };\n }\n\n return {\n mode: 'SELECT',\n idx: selectedPosition.idx,\n onFocus: handleFocus,\n onKeyDown: handleKeyDown,\n dragHandleProps:\n enableCellDragAndDrop && isCellEditable(selectedPosition)\n ? { onMouseDown: handleMouseDown, onDoubleClick: handleDoubleClick }\n : undefined\n };\n }\n\n function getViewportRows() {\n const rowElements = [];\n let startRowIndex = 0;\n for (let rowIdx = rowOverscanStartIdx; rowIdx <= rowOverscanEndIdx; rowIdx++) {\n const row = rows[rowIdx];\n const top = getRowTop(rowIdx) + headerRowHeight;\n if (isGroupRow(row)) {\n ({ startRowIndex } = row);\n const isGroupRowSelected =\n isSelectable && row.childRows.every((cr) => selectedRows?.has(rowKeyGetter!(cr)));\n rowElements.push(\n <GroupRowRenderer\n aria-level={row.level + 1} // aria-level is 1-based\n aria-setsize={row.setSize}\n aria-posinset={row.posInSet + 1} // aria-posinset is 1-based\n aria-rowindex={headerRowsCount + startRowIndex + 1} // aria-rowindex is 1 based\n aria-selected={isSelectable ? isGroupRowSelected : undefined}\n key={row.id}\n id={row.id}\n groupKey={row.groupKey}\n viewportColumns={viewportColumns}\n childRows={row.childRows}\n rowIdx={rowIdx}\n top={top}\n height={getRowHeight(rowIdx)}\n level={row.level}\n isExpanded={row.isExpanded}\n selectedCellIdx={selectedPosition.rowIdx === rowIdx ? selectedPosition.idx : undefined}\n isRowSelected={isGroupRowSelected}\n onFocus={selectedPosition.rowIdx === rowIdx ? handleFocus : undefined}\n onKeyDown={selectedPosition.rowIdx === rowIdx ? handleKeyDown : undefined}\n selectCell={selectCellWrapper}\n toggleGroup={toggleGroupWrapper}\n />\n );\n continue;\n }\n\n startRowIndex++;\n let key;\n let isRowSelected = false;\n if (typeof rowKeyGetter === 'function') {\n key = rowKeyGetter(row);\n isRowSelected = selectedRows?.has(key) ?? false;\n } else {\n key = hasGroups ? startRowIndex : rowIdx;\n }\n\n rowElements.push(\n <RowRenderer\n aria-rowindex={headerRowsCount + (hasGroups ? startRowIndex : rowIdx) + 1} // aria-rowindex is 1 based\n aria-selected={isSelectable ? isRowSelected : undefined}\n key={key}\n rowIdx={rowIdx}\n row={row}\n viewportColumns={viewportColumns}\n isRowSelected={isRowSelected}\n onRowClick={onRowClick}\n rowClass={rowClass}\n top={top}\n height={getRowHeight(rowIdx)}\n copiedCellIdx={\n copiedCell !== null && copiedCell.row === row\n ? columns.findIndex((c) => c.key === copiedCell.columnKey)\n : undefined\n }\n draggedOverCellIdx={getDraggedOverCellIdx(rowIdx)}\n setDraggedOverRowIdx={isDragging ? setDraggedOverRowIdx : undefined}\n lastFrozenColumnIndex={lastFrozenColumnIndex}\n selectedCellProps={getSelectedCellProps(rowIdx)}\n onRowChange={handleFormatterRowChangeWrapper}\n selectCell={selectCellWrapper}\n />\n );\n }\n\n return rowElements;\n }\n\n // Reset the positions if the current values are no longer valid. This can happen if a column or row is removed\n if (selectedPosition.idx >= columns.length || selectedPosition.rowIdx >= rows.length) {\n setSelectedPosition(initialPosition);\n setDraggedOverRowIdx(undefined);\n }\n\n if (\n selectedPosition.mode === 'EDIT' &&\n rows[selectedPosition.rowIdx] !== selectedPosition.originalRow\n ) {\n // Discard changes if rows are updated from outside\n closeEditor();\n }\n\n return (\n <div\n role={hasGroups ? 'treegrid' : 'grid'}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n aria-describedby={ariaDescribedBy}\n aria-multiselectable={isSelectable ? true : undefined}\n aria-colcount={columns.length}\n aria-rowcount={headerRowsCount + rowsCount + summaryRowsCount}\n className={clsx(rootClassname, { [viewportDraggingClassname]: isDragging }, className)}\n style={\n {\n ...style,\n '--header-row-height': `${headerRowHeight}px`,\n '--row-width': `${totalColumnWidth}px`,\n '--summary-row-height': `${summaryRowHeight}px`,\n ...layoutCssVars\n } as unknown as React.CSSProperties\n }\n ref={gridRef}\n onScroll={handleScroll}\n >\n <HeaderRow\n rowKeyGetter={rowKeyGetter}\n rows={rawRows}\n columns={viewportColumns}\n onColumnResize={handleColumnResize}\n allRowsSelected={allRowsSelected}\n onSelectedRowsChange={onSelectedRowsChange}\n sortColumns={sortColumns}\n onSortColumnsChange={onSortColumnsChange}\n lastFrozenColumnIndex={lastFrozenColumnIndex}\n />\n {rows.length === 0 && EmptyRowsRenderer ? (\n <EmptyRowsRenderer />\n ) : (\n <>\n {/*\n Ideally the focus should be set on the selected cell\n (https://www.w3.org/TR/wai-aria-practices-1.2/#kbd_roving_tabindex)\n but there are a few issues with this approach\n - onKeyDown/useLayoutEffect on the cell is not fast enough and grid\n looses focus if tab is pressed repeatedly\n - All the cells are not rendered so it is possible the focused cell\n is not in the viewport and unmounted and in this case the grid\n does not have any focusable element\n\n This first issue can be solved by setting onKeyDown on the root element\n but for the second issue we need to render the selected cell along with\n the cells in the viewport. This adds complexity.\n\n To circumvent this issue we are using an extra div element which is\n positioned on the top/left corner of the viewport and it listens for the\n keyboard event and sets the selected cell's position.\n */}\n <div\n ref={focusSinkRef}\n tabIndex={0}\n className={focusSinkClassname}\n onKeyDown={handleKeyDown}\n onFocus={onGridFocus}\n />\n <div style={{ height: max(totalRowHeight, clientHeight) }} />\n <RowSelectionChangeProvider value={selectRowWrapper}>\n {getViewportRows()}\n </RowSelectionChangeProvider>\n {summaryRows?.map((row, rowIdx) => (\n <SummaryRow\n aria-rowindex={headerRowsCount + rowsCount + rowIdx + 1}\n key={rowIdx}\n rowIdx={rowIdx}\n row={row}\n bottom={summaryRowHeight * (summaryRows.length - 1 - rowIdx)}\n viewportColumns={viewportColumns}\n lastFrozenColumnIndex={lastFrozenColumnIndex}\n />\n ))}\n </>\n )}\n </div>\n );\n}\n\nexport default forwardRef(DataGrid) as <R, SR = unknown, K extends Key = Key>(\n props: DataGridProps<R, SR, K> & RefAttributes<DataGridHandle>\n) => JSX.Element;\n","import { Widget } from \"@hpcc-js/common\";\r\nimport * as React from \"react\";\r\n\r\nexport function useData(widget: Widget): [string[], Array<string | number>[]] {\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n const columns: string[] = React.useMemo(() => widget.columns(), [widget, widget.dataChecksum()]);\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n const data: Array<string | number>[] = React.useMemo(() => widget.data(), [widget, widget.dataChecksum()]);\r\n\r\n return [columns, data];\r\n}\r\n\r\n","import * as React from \"react\";\r\nimport DataGrid, { Column, SelectColumn, SortColumn } from \"react-data-grid\";\r\nimport { format, timeFormat, timeParse } from \"@hpcc-js/common\";\r\nimport { useData } from \"./hooks\";\r\nimport type { Table } from \"./table\";\r\n\r\nexport type QuerySortItem = { attribute: string, descending: boolean };\r\nfunction copyAndSort<T>(items: T[], attribute: string, descending?: boolean): T[] {\r\n const key = attribute as keyof T;\r\n return [...items].sort((a: T, b: T) => {\r\n if (a[key] < b[key]) {\r\n return descending ? 1 : -1;\r\n } else if (a[key] > b[key]) {\r\n return descending ? -1 : 1;\r\n }\r\n return 0;\r\n });\r\n}\r\n\r\ninterface EmptyRowsRendererProps {\r\n message: string\r\n}\r\n\r\nconst EmptyRowsRenderer: React.FunctionComponent<EmptyRowsRendererProps> = ({\r\n message\r\n}) => {\r\n\r\n return <div style={{ textAlign: \"center\", gridColumn: \"1/-1\" }} >\r\n {message}\r\n </div>;\r\n};\r\n\r\ninterface ColumnEx<TRow, TSummaryRow = unknown> extends Column<TRow, TSummaryRow> {\r\n renderCell?: (props: any) => React.JSX.Element;\r\n __hpcc_pattern?: ReturnType<typeof timeParse>;\r\n __hpcc_format?: ReturnType<typeof format> | ReturnType<typeof timeFormat>;\r\n}\r\n\r\nexport interface ReactTableProps {\r\n table: Table;\r\n sort?: QuerySortItem,\r\n}\r\n\r\nexport const ReactTable: React.FunctionComponent<ReactTableProps> = ({\r\n table,\r\n sort\r\n}) => {\r\n const [columns, data] = useData(table);\r\n const multiSelect = table.multiSelect();\r\n const columnTypes = table.columnTypes();\r\n const columnPatterns = table.columnPatterns();\r\n const columnFormats = table.columnFormats();\r\n\r\n const [listColumns, setListColumns] = React.useState<ColumnEx<any[]>[]>([]);\r\n const [sortColumn, setSortColumn] = React.useState<SortColumn>();\r\n const [rows, setRows] = React.useState<any[]>([]);\r\n const [selectedRows, setSelectedRows] = React.useState<ReadonlySet<number>>(new Set());\r\n\r\n // Columns ---\r\n React.useEffect(() => {\r\n setListColumns([\r\n ...multiSelect ? [SelectColumn] : [],\r\n ...columns.map((column): ColumnEx<any[]> => {\r\n const type = columnTypes[column] ?? \"string\";\r\n let formatter;\r\n let __hpcc_pattern;\r\n let __hpcc_format;\r\n switch (type) {\r\n case \"time\":\r\n __hpcc_pattern = columnPatterns[column] !== undefined ? timeParse(columnPatterns[column]) : undefined;\r\n __hpcc_format = columnFormats[column] !== undefined ? timeFormat(columnFormats[column]) : undefined;\r\n break;\r\n case \"number\":\r\n formatter = (props) => {\r\n return <div style={{ textAlign: \"right\" }}>{props.row[props.column.key]}</div>;\r\n };\r\n // eslint-disable-next-line no-fallthrough\r\n default:\r\n __hpcc_format = columnFormats[column] !== undefined ? format(columnFormats[column]) : undefined;\r\n }\r\n return {\r\n key: column,\r\n name: column,\r\n resizable: true,\r\n sortable: true,\r\n minWidth: 80,\r\n renderCell: formatter,\r\n __hpcc_pattern,\r\n __hpcc_format\r\n };\r\n })\r\n ]);\r\n }, [columnFormats, columnPatterns, columnTypes, columns, multiSelect]);\r\n\r\n const onSortColumnsChange = React.useCallback((sortColumns: SortColumn[]) => {\r\n const futureSortColumn = sortColumns.slice(-1)[0];\r\n const sorted = futureSortColumn !== undefined;\r\n const isSortedDescending: boolean = futureSortColumn?.direction === \"DESC\";\r\n setSortColumn(futureSortColumn);\r\n setRows(copyAndSort(rows, sorted ? futureSortColumn.columnKey : \"key\", sorted ? isSortedDescending : false));\r\n }, [rows]);\r\n\r\n const rowKeyGetter = React.useCallback((row: any) => {\r\n return row.key;\r\n }, []);\r\n\r\n const onSelectedRowsChange = React.useCallback((selectedRows: Set<any>) => {\r\n setSelectedRows(selectedRows);\r\n }, []);\r\n\r\n const onCellClick = React.useCallback((row, column) => {\r\n table.onRowClickCallback(row, column.key);\r\n }, [table]);\r\n\r\n // Rows ---\r\n React.useEffect(() => {\r\n let items = data.map((row, index) => {\r\n const retVal = {\r\n key: index\r\n };\r\n listColumns.forEach((column, index) => {\r\n let val = row[index] as string;\r\n if (column.__hpcc_pattern && column.__hpcc_format) {\r\n val = column.__hpcc_format(column.__hpcc_pattern(val));\r\n } else if (column.__hpcc_pattern) {\r\n val = column.__hpcc_pattern(val).toString();\r\n } else if (column.__hpcc_format) {\r\n val = column.__hpcc_format(val as any);\r\n }\r\n retVal[column.key] = val;\r\n });\r\n return retVal;\r\n });\r\n if (sort?.attribute) {\r\n items = copyAndSort(items, sort.attribute, sort.descending);\r\n }\r\n setRows(items);\r\n }, [listColumns, data, sort]);\r\n\r\n return <DataGrid\r\n columns={listColumns}\r\n headerRowHeight={24}\r\n rows={rows}\r\n rowKeyGetter={rowKeyGetter}\r\n rowHeight={20}\r\n emptyRowsRenderer={() => <EmptyRowsRenderer message={table.noDataMessage()} />}\r\n className={table.darkMode() ? \"rdg-dark\" : \"rdg-light\"}\r\n sortColumns={sortColumn ? [sortColumn] : []}\r\n onSortColumnsChange={onSortColumnsChange}\r\n selectedRows={selectedRows}\r\n onSelectedRowsChange={multiSelect ? onSelectedRowsChange : undefined}\r\n onRowClick={multiSelect ? undefined : (rowIdx, row, column) => onCellClick(row, column)}\r\n aria-describedby={\"\"}\r\n aria-label={\"\"}\r\n aria-labelledby={\"\"}\r\n style={{ height: \"100%\" }}\r\n />;\r\n};\r\n\r\n","function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n","import * as React from \"react\";\r\nimport { HTMLWidget, publish } from \"@hpcc-js/common\";\r\nimport { render, unmountComponentAtNode } from \"react-dom\";\r\nimport { ReactTable } from \"./reactTable\";\r\n\r\nimport \"../src/table.css\";\r\n\r\nexport type ColumnType = \"boolean\" | \"number\" | \"string\" | \"time\";\r\n\r\nexport class Table extends HTMLWidget {\r\n\r\n protected _div;\r\n\r\n constructor() {\r\n super();\r\n }\r\n\r\n @publish(\"...empty...\", \"string\", \"No Data Message\")\r\n noDataMessage: publish<this, string>;\r\n @publish(false, \"boolean\", \"Dark Mode\")\r\n darkMode: publish<this, boolean>;\r\n @publish(false, \"boolean\", \"Multiple Selection\")\r\n multiSelect: publish<this, boolean>;\r\n @publish({}, \"object\", \"Column Types (\\\"boolean\\\" | \\\"number\\\" | \\\"string\\\" | \\\"time\\\"\")\r\n columnTypes: publish<this, { [column: string]: ColumnType }>;\r\n @publish({}, \"object\", \"Column Patterns\")\r\n columnPatterns: publish<this, { [column: string]: string }>;\r\n @publish({}, \"object\", \"Column Formats\")\r\n columnFormats: publish<this, { [column: string]: string }>;\r\n\r\n columnType(column: string): ColumnType;\r\n columnType(column: string, type: ColumnType): this;\r\n columnType(column: string, type?: ColumnType): ColumnType | this {\r\n if (arguments.length === 1) return this.columnTypes()[column];\r\n this.columnTypes({ ...this.columnTypes(), [column]: type });\r\n return this;\r\n }\r\n\r\n columnPattern(column: string): string;\r\n columnPattern(column: string, pattern: string): this;\r\n columnPattern(column: string, pattern?: string): string | this {\r\n if (arguments.length === 1) return this.columnPatterns()[column];\r\n this.columnPatterns({ ...this.columnPatterns(), [column]: pattern });\r\n return this;\r\n }\r\n\r\n columnFormat(column: string): string;\r\n columnFormat(column: string, format: string): this;\r\n columnFormat(column: string, format?: string): string | this {\r\n if (arguments.length === 1) return this.columnFormats()[column];\r\n this.columnFormats({ ...this.columnFormats(), [column]: format });\r\n return this;\r\n }\r\n\r\n private _prevRow;\r\n private _prevColumn;\r\n onRowClickCallback(row, column) {\r\n if (this._prevRow && JSON.stringify(this._prevRow) !== JSON.stringify(row)) {\r\n this.click(this._prevRow, this._prevColumn ?? \"\", false);\r\n }\r\n if (row) {\r\n this.click(row, column, true);\r\n }\r\n this._prevRow = row;\r\n this._prevColumn = column;\r\n }\r\n\r\n enter(domNode, element) {\r\n super.enter(domNode, element);\r\n this._div = element\r\n .append(\"div\")\r\n ;\r\n }\r\n\r\n update(domNode, element) {\r\n super.update(domNode, element);\r\n this._div.style(\"width\", this.width() + \"px\");\r\n this._div.style(\"height\", this.height() + \"px\");\r\n render(React.createElement(ReactTable, { table: this }), this._div.node());\r\n }\r\n\r\n exit(domNode, element) {\r\n unmountComponentAtNode(this._div.node());\r\n this._div.remove();\r\n super.exit(domNode, element);\r\n }\r\n\r\n // Events ---\r\n click(row, col, sel) {\r\n }\r\n}\r\nTable.prototype._class += \" dgrid2_Table\";\r\n"],"names":["slice","options","vnodeId","rerenderQueue","prevDebounce","defer","depthSort","CAPTURE_REGEX","eventClock","eventProxy","eventProxyCapture","i","EMPTY_OBJ","EMPTY_ARR","IS_NON_DIMENSIONAL","isArray","Array","assign","obj","props","removeNode","node","parentNode","removeChild","createElement","type","children","key","ref","normalizedProps","arguments","length","call","defaultProps","undefined","createVNode","original","vnode","__k","__","__b","__e","__c","constructor","__v","__i","__u","Fragment","BaseComponent","context","this","getDomSibling","childIndex","sibling","updateParentDomPointers","child","base","enqueueRender","c","__d","push","process","__r","debounceRendering","component","newVNode","oldVNode","oldDom","commitQueue","refQueue","l","sort","shift","__P","diff","__n","namespaceURI","commitRoot","diffChildren","parentDom","renderResult","newParentVNode","oldParentVNode","globalContext","namespace","excessDomChildren","isHydrating","childVNode","newDom","firstChildDom","result","shouldPlace","oldChildren","newChildrenLength","constructNewChildrenArray","applyRef","insert","nextSibling","skewedIndex","matchingIndex","oldChildrenLength","remainingOldChildren","skew","String","findMatchingIndex","unmount","parentVNode","insertBefore","nodeType","toChildArray","out","some","x","y","matched","setStyle","style","value","setProperty","test","dom","name","oldValue","useCapture","lowerCaseName","o","cssText","replace","toLowerCase","_attached","addEventListener","removeEventListener","e","removeAttribute","setAttribute","createEventProxy","eventHandler","_dispatched","event","tmp","isNew","oldProps","oldState","snapshot","clearProcessingException","newProps","isClassComponent","provider","componentContext","renderHook","count","newType","outer","prototype","render","contextType","__E","doRender","sub","state","__h","_sb","__s","getDerivedStateFromProps","componentWillMount","componentDidMount","componentWillReceiveProps","shouldComponentUpdate","componentWillUpdate","componentDidUpdate","getChildContext","getSnapshotBeforeUpdate","cloneNode","then","MODE_HYDRATE","indexOf","markAsForce","diffElementNodes","diffed","forEach","root","cb","map","newHtml","oldHtml","newChildren","inputValue","checked","localName","document","createTextNode","createElementNS","is","__m","data","childNodes","attributes","__html","innerHTML","content","hasRefUnmount","current","skipRemove","r","componentWillUnmount","replaceNode","documentElement","firstChild","createContext","defaultValue","Context","subs","ctx","Set","_props","add","old","delete","Provider","__l","Consumer","contextValue","error","errorInfo","ctor","handled","getDerivedStateFromError","setState","componentDidCatch","update","callback","s","forceUpdate","Promise","bind","resolve","setTimeout","a","b","currentIndex","currentComponent","previousComponent","prevRaf","currentHook","afterPaintEffects","_options","oldBeforeDiff","oldBeforeRender","oldAfterDiff","oldCommit","oldBeforeUnmount","oldRoot","getHookState","index","hooks","__H","useState","initialState","useReducer","invokeOrReturn","reducer","init","hookState","_reducer","action","currentValue","__N","nextValue","__f","updateHookState","p","stateHooks","filter","every","prevScu","shouldUpdate","hookItem","prevCWU","useEffect","args","argsChanged","_pendingArgs","useLayoutEffect","useRef","initialValue","useMemo","useImperativeHandle","createHandle","concat","factory","useCallback","useContext","flushAfterPaintEffects","invokeCleanup","invokeEffect","requestAnimationFrame","afterNextFrame","hasErrored","HAS_RAF","raf","done","clearTimeout","timeout","cancelAnimationFrame","hook","comp","cleanup","oldArgs","newArgs","arg","f","shallowDiffers","PureComponent","memo","comparer","nextProps","updateRef","Memoed","displayName","isReactComponent","Component","isPureReactComponent","oldDiffHook","REACT_FORWARD_SYMBOL","Symbol","for","forwardRef","fn","Forwarded","clone","$$typeof","oldCatchError","oldUnmount","detachedClone","detachedParent","effect","removeOriginal","originalParent","appendChild","Suspense","_suspenders","suspended","__a","SuspenseList","_next","_map","__z","__R","promise","suspendingVNode","suspendingComponent","resolved","onResolved","onSuspensionComplete","originalParentDom","suspendedVNode","__O","pop","detachedComponent","fallback","list","revealOrder","size","ContextProvider","Portal","_this","container","_container","_temp","contains","before","splice","createPortal","el","containerInfo","delegated","get","unsuspend","wrappedUnsuspend","Map","reverse","set","REACT_ELEMENT_TYPE","CAMEL_PROPS","ON_ANI","CAMEL_REPLACE","IS_DOM","onChangeInputType","parent","textContent","preactRender","Object","defineProperty","configurable","v","writable","oldEventHook","empty","isPropagationStopped","cancelBubble","isDefaultPrevented","defaultPrevented","persist","nativeEvent","classNameDescriptorNonEnumberable","enumerable","class","oldVNodeHook","isNonDashedType","lowerCased","multiple","selected","className","handleDomVNode","oldDiffed","unmountComponentAtNode","isStaticChildren","__source","__self","styleInject","cell","cellClassname","cellFrozen","cellFrozenClassname","cellFrozenLast","cellFrozenLastClassname","rootClassname","focusSink","focusSinkClassname","viewportDragging","viewportDraggingClassname","groupRow","groupRowClassname","groupRowSelected","groupRowSelectedClassname","headerRow","headerRowClassname","row","rowClassname","summaryRow","summaryRowClassname","useFocusRef","isCellSelected","focus","preventScroll","checkboxLabel","checkboxLabelClassname","checkboxInput","checkboxInputClassname","checkbox","checkboxClassname","checkboxLabelDisabled","checkboxLabelDisabledClassname","SelectCellFormatter","tabIndex","disabled","onClick","onChange","ariaLabel","ariaLabelledBy","inputRef","handleChange","target","shiftKey","_jsxs","clsx","_jsx","ValueFormatter","column","groupCellContent","groupCellContentClassname","caret","caretClassname","ToggleGroupFormatter","groupKey","isExpanded","toggleGroup","cellRef","handleKeyDown","d","getColSpan","lastFrozenColumnIndex","colSpan","Number","isInteger","frozen","idx","stopPropagation","nonInputKeys","isCtrlKeyHeldDown","ctrlKey","metaKey","isDefaultCellInput","has","onEditorNavigation","HTMLInputElement","HTMLTextAreaElement","HTMLSelectElement","matches","isSelectedCellEditable","selectedPosition","columns","rows","isGroupRow","rowIdx","isCellEditable","editor","rowGroup","editable","getNextSelectedCellPosition","cellNavigationMode","colSpanColumns","currentPosition","nextPosition","isCellWithinBounds","rowsCount","position","setColSpan","moveRight","posIdx","colIdx","columnsCount","isAfterLastColumn","isBeforeFirstColumn","isLastRow","isFirstRow","canExitGrid","atLastCellInRow","atFirstCellInRow","atLastRow","atFirstRow","min","max","floor","ceil","sign","Math","assertIsValidKeyGetter","keyGetter","Error","getCellStyle","gridColumnStart","gridColumnEnd","left","getCellClassname","extraClasses","isLastFrozenColumn","SELECT_COLUMN_KEY","SelectFormatter","isRowSelected","onRowSelectionChange","useRowSelection","isShiftClick","SelectGroupFormatter","SelectColumn","width","maxWidth","resizable","sortable","headerRenderer","allRowsSelected","onAllRowsSelectionChange","formatter","groupFormatter","useCalculatedColumns","rawColumns","columnWidths","viewportWidth","scrollLeft","defaultColumnOptions","rawGroupBy","enableVirtualization","minColumnWidth","minWidth","defaultFormatter","defaultSortable","defaultResizable","groupBy","rawColumn","includes","aKey","frozenA","bKey","frozenB","layoutCssVars","totalColumnWidth","totalFrozenColumnWidth","columnMetrics","templateColumns","allocatedWidth","unassignedColumnsCount","getSpecifiedWidth","clampColumnWidth","unallocatedWidth","unallocatedColumnWidth","columnMetric","colOverscanStartIdx","colOverscanEndIdx","viewportLeft","viewportRight","lastColIdx","firstUnfrozenColumnIdx","colVisibleStartIdx","colVisibleEndIdx","parseInt","useGridDimensions","gridRef","gridWidth","setGridWidth","gridHeight","setGridHeight","ResizeObserver","window","resizeObserver","clientWidth","clientHeight","devicePixelRatio","observe","disconnect","useLatestFunc","RowSelectionContext","RowSelectionProvider","RowSelectionChangeContext","RowSelectionChangeProvider","rowSelectionContext","rowSelectionChangeContext","useViewportColumns","summaryRows","rowOverscanStartIdx","rowOverscanEndIdx","startIdx","updateStartIdx","viewportColumns","RENDER_BATCH_SIZE","isReadonlyArray","arr","useViewportRows","rawRows","rowHeight","scrollTop","rowGrouper","expandedGroupIds","groupedRows","groupRows","groupByKey","remainingGroupByKeys","startRowIndex","groupRowsCount","groups","childRows","entries","childGroups","childRowsCount","allGroupRows","flattenedRows","expandGroup","parentId","level","keys","posInSet","id","setSize","totalRowHeight","getRowTop","getRowHeight","findRowIdx","offset","rowPositions","currentRowHeight","top","height","validateRowIdx","start","end","middle","currentOffset","overscanThreshold","rowVisibleStartIdx","rowVisibleEndIdx","headerSortCell","headerSortCellClassname","headerSortName","headerSortNameClassname","SortableHeaderCell","onSort","sortDirection","priority","sortText","cellResizable","cellResizableClassname","HeaderCell","onResize","sortColumns","onSortColumnsChange","onPointerDown","pointerType","buttons","currentTarget","pointerId","right","getBoundingClientRect","clientX","onPointerMove","onPointerUp","preventDefault","sortIndex","findIndex","columnKey","sortColumn","direction","ariaSort","ctrlClick","sortDescendingFirst","nextSort","nextSortColumn","nextSortColumns","getCell","headerCellClass","HeaderRow","rowKeyGetter","onSelectedRowsChange","onColumnResize","handleAllRowsSelectionChange","newSelectedRows","cells","cellCopied","cellCopiedClassname","cellDraggedOver","cellDraggedOverClassname","cellDragHandle","cellDragHandleClassname","Cell","isCopied","isDraggedOver","dragHandleProps","onRowClick","onDoubleClick","onContextMenu","onRowChange","selectCell","cellClass","selectCellWrapper","openEditor","handleClick","editorOptions","editOnClick","handleContextMenu","handleDoubleClick","handleRowChange","newRow","cellEditing","cellEditingClassname","EditCell","onClose","onKeyDown","editorPortalTarget","frameRequestRef","commitOnOutsideMouseDown","cancelFrameRequest","onWindowCaptureMouseDown","capture","Row","cellRenderer","copiedCellIdx","draggedOverCellIdx","selectedCellProps","rowClass","setDraggedOverRowIdx","onMouseEnter","handleDragEnter","CellRenderer","mode","editorProps","onFocus","GroupCell","groupColumnIndex","toggleGroupWrapper","isLevelMatching","cursor","GroupedRow","selectedCellIdx","selectGroup","SummaryCell","summaryFormatter","SummaryFormatter","summaryCellClass","SummaryRow","bottom","ariaRowIndex","body","globalThis","initialPosition","DataGrid","onRowsChange","headerRowHeight","rawHeaderRowHeight","summaryRowHeight","rawSummaryRowHeight","selectedRows","onExpandedGroupIdsChange","rowRenderer","emptyRowsRenderer","EmptyRowsRenderer","onScroll","onSelectedCellChange","onFill","onPaste","rawCellNavigationMode","rawEditorPortalTarget","ariaDescribedBy","RowRenderer","setScrollTop","setScrollLeft","setColumnWidths","setSelectedPosition","copiedCell","setCopiedCell","isDragging","setDragging","draggedOverRowIdx","setOverRowIdx","focusSinkRef","prevSelectedPosition","latestDraggedOverRowIdx","lastSelectedRowIdx","isCellFocusable","selectRowWrapper","selectRow","handleFormatterRowChangeWrapper","updateRow","headerRowsCount","summaryRowsCount","isSelectable","hasGroups","minColIdx","enableCellDragAndDrop","scrollToCell","element","scrollToColumn","scrollToRow","scrollTo","behavior","handleColumnResize","newColumnWidths","childRow","rowKey","previousRowIdx","step","expandedGroupId","newExpandedGroupIds","onGridFocus","keyCode","cKey","vKey","handleCopy","handlePaste","closeEditor","navigate","handleCellInput","handleFocus","handleScroll","getRawRowIdx","updatedRows","indexes","commitEditorChanges","originalRow","targetRow","updatedTargetRow","sourceRow","sourceColumnKey","targetColumnKey","onCellKeyDown","handleDragEnd","overRowIdx","endRowIndex","targetRows","updatedTargetRows","targetRowIdx","handleMouseDown","onMouseOver","onMouseUp","handleEditorRowChange","commitChanges","handleOnClose","enableEditor","isCellAtLeftBoundary","isCellAtRightBoundary","rowTop","getNextPosition","parentRowIdx","parentRow","nextRowY","onNavigation","getDraggedOverCellIdx","currentRowIdx","getSelectedCellProps","onMouseDown","getViewportRows","rowElements","isGroupRowSelected","cr","React.useMemo","React.createElement","React.useState","React.useEffect","timeParse","timeFormat","format","React.useCallback","publish","HTMLWidget"],"mappings":";;;;;;AAAO,MAAM,QAAQ,GAAG;AACjB,MAAM,WAAW,GAAG;AACpB,MAAM,aAAa,GAAG;;ECF7B;EACA;;EAEA;EACA;;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;EAEA,IAAI,aAAa,GAAG,SAAS,CAAC,EAAE,CAAC,EAAE;EACnC,EAAE,aAAa,GAAG,MAAM,CAAC,cAAc;EACvC,OAAO,EAAE,SAAS,EAAE,EAAE,EAAE,YAAY,KAAK,IAAI,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,SAAS,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;EAClF,MAAM,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,KAAK,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;EACvG,EAAE,OAAO,aAAa,CAAC,CAAC,EAAE,CAAC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oreList":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,62]}
1
+ {"version":3,"file":"index.js","sources":["../src/__package__.ts","../../../node_modules/tslib/tslib.es6.mjs","../../../node_modules/preact/src/constants.js","../../../node_modules/preact/src/util.js","../../../node_modules/preact/src/options.js","../../../node_modules/preact/src/create-element.js","../../../node_modules/preact/src/component.js","../../../node_modules/preact/src/diff/props.js","../../../node_modules/preact/src/create-context.js","../../../node_modules/preact/src/diff/children.js","../../../node_modules/preact/src/diff/index.js","../../../node_modules/preact/src/render.js","../../../node_modules/preact/src/diff/catch-error.js","../../../node_modules/preact/hooks/src/index.js","../../../node_modules/preact/compat/src/util.js","../../../node_modules/preact/compat/src/hooks.js","../../../node_modules/preact/compat/src/PureComponent.js","../../../node_modules/preact/compat/src/memo.js","../../../node_modules/preact/compat/src/forwardRef.js","../../../node_modules/preact/compat/src/Children.js","../../../node_modules/preact/compat/src/suspense.js","../../../node_modules/preact/compat/src/suspense-list.js","../../../node_modules/preact/compat/src/portals.js","../../../node_modules/preact/compat/src/render.js","../../../node_modules/preact/compat/src/index.js","../../../node_modules/clsx/dist/clsx.m.js","../../../node_modules/preact/jsx-runtime/src/index.js","../../../node_modules/react-data-grid/node_modules/style-inject/dist/style-inject.es.js","../../../node_modules/react-data-grid/src/style/cell.ts","../../../node_modules/react-data-grid/src/style/core.ts","../../../node_modules/react-data-grid/src/style/grouprow.ts","../../../node_modules/react-data-grid/src/style/header.ts","../../../node_modules/react-data-grid/src/style/row.ts","../../../node_modules/react-data-grid/src/hooks/useFocusRef.ts","../../../node_modules/react-data-grid/src/formatters/SelectCellFormatter.tsx","../../../node_modules/react-data-grid/src/formatters/ValueFormatter.tsx","../../../node_modules/react-data-grid/src/formatters/ToggleGroupFormatter.tsx","../../../node_modules/react-data-grid/src/utils/colSpanUtils.ts","../../../node_modules/react-data-grid/src/utils/domUtils.ts","../../../node_modules/react-data-grid/src/utils/keyboardUtils.ts","../../../node_modules/react-data-grid/src/utils/selectedCellUtils.ts","../../../node_modules/react-data-grid/src/utils/index.ts","../../../node_modules/react-data-grid/src/Columns.tsx","../../../node_modules/react-data-grid/src/hooks/useCalculatedColumns.ts","../../../node_modules/react-data-grid/src/hooks/useGridDimensions.ts","../../../node_modules/react-data-grid/src/hooks/useLatestFunc.ts","../../../node_modules/react-data-grid/src/hooks/useRowSelection.ts","../../../node_modules/react-data-grid/src/hooks/useViewportColumns.ts","../../../node_modules/react-data-grid/src/hooks/useViewportRows.ts","../../../node_modules/react-data-grid/src/headerCells/SortableHeaderCell.tsx","../../../node_modules/react-data-grid/src/HeaderCell.tsx","../../../node_modules/react-data-grid/src/HeaderRow.tsx","../../../node_modules/react-data-grid/src/Cell.tsx","../../../node_modules/react-data-grid/src/EditCell.tsx","../../../node_modules/react-data-grid/src/Row.tsx","../../../node_modules/react-data-grid/src/GroupCell.tsx","../../../node_modules/react-data-grid/src/GroupRow.tsx","../../../node_modules/react-data-grid/src/SummaryCell.tsx","../../../node_modules/react-data-grid/src/SummaryRow.tsx","../../../node_modules/react-data-grid/src/DataGrid.tsx","../src/hooks.ts","../src/reactTable.tsx","../../../node_modules/style-inject/dist/style-inject.es.js","../src/table.ts"],"sourcesContent":["export const PKG_NAME = \"@hpcc-js/dgrid2\";\nexport const PKG_VERSION = \"2.5.4\";\nexport const BUILD_VERSION = \"2.108.8\";\n","/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n }\n return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nvar ownKeys = function(o) {\n ownKeys = Object.getOwnPropertyNames || function (o) {\n var ar = [];\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\n return ar;\n };\n return ownKeys(o);\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport function __addDisposableResource(env, value, async) {\n if (value !== null && value !== void 0) {\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\n var dispose, inner;\n if (async) {\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\n dispose = value[Symbol.asyncDispose];\n }\n if (dispose === void 0) {\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\n dispose = value[Symbol.dispose];\n if (async) inner = dispose;\n }\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\n env.stack.push({ value: value, dispose: dispose, async: async });\n }\n else if (async) {\n env.stack.push({ async: true });\n }\n return value;\n}\n\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n var e = new Error(message);\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n};\n\nexport function __disposeResources(env) {\n function fail(e) {\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\n env.hasError = true;\n }\n var r, s = 0;\n function next() {\n while (r = env.stack.pop()) {\n try {\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\n if (r.dispose) {\n var result = r.dispose.call(r.value);\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n }\n else s |= 1;\n }\n catch (e) {\n fail(e);\n }\n }\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\n if (env.hasError) throw env.error;\n }\n return next();\n}\n\nexport function __rewriteRelativeImportExtension(path, preserveJsx) {\n if (typeof path === \"string\" && /^\\.\\.?\\//.test(path)) {\n return path.replace(/\\.(tsx)$|((?:\\.d)?)((?:\\.[^./]+?)?)\\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {\n return tsx ? preserveJsx ? \".jsx\" : \".js\" : d && (!ext || !cm) ? m : (d + ext + \".\" + cm.toLowerCase() + \"js\");\n });\n }\n return path;\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __esDecorate,\n __runInitializers,\n __propKey,\n __setFunctionName,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n __addDisposableResource,\n __disposeResources,\n __rewriteRelativeImportExtension,\n};\n","/** Normal hydration that attaches to a DOM tree but does not diff it. */\nexport const MODE_HYDRATE = 1 << 5;\n/** Signifies this VNode suspended on the previous render */\nexport const MODE_SUSPENDED = 1 << 7;\n/** Indicates that this node needs to be inserted while patching children */\nexport const INSERT_VNODE = 1 << 2;\n/** Indicates a VNode has been matched with another VNode in the diff */\nexport const MATCHED = 1 << 1;\n\n/** Reset all mode flags */\nexport const RESET_MODE = ~(MODE_HYDRATE | MODE_SUSPENDED);\n\nexport const SVG_NAMESPACE = 'http://www.w3.org/2000/svg';\nexport const XHTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';\nexport const MATH_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';\n\nexport const NULL = null;\nexport const UNDEFINED = undefined;\nexport const EMPTY_OBJ = /** @type {any} */ ({});\nexport const EMPTY_ARR = [];\nexport const IS_NON_DIMENSIONAL =\n\t/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;\n","import { EMPTY_ARR } from './constants';\n\nexport const isArray = Array.isArray;\n\n/**\n * Assign properties from `props` to `obj`\n * @template O, P The obj and props types\n * @param {O} obj The object to copy properties to\n * @param {P} props The object to copy properties from\n * @returns {O & P}\n */\nexport function assign(obj, props) {\n\t// @ts-expect-error We change the type of `obj` to be `O & P`\n\tfor (let i in props) obj[i] = props[i];\n\treturn /** @type {O & P} */ (obj);\n}\n\n/**\n * Remove a child node from its parent if attached. This is a workaround for\n * IE11 which doesn't support `Element.prototype.remove()`. Using this function\n * is smaller than including a dedicated polyfill.\n * @param {import('./index').ContainerNode} node The node to remove\n */\nexport function removeNode(node) {\n\tif (node && node.parentNode) node.parentNode.removeChild(node);\n}\n\nexport const slice = EMPTY_ARR.slice;\n","import { _catchError } from './diff/catch-error';\n\n/**\n * The `option` object can potentially contain callback functions\n * that are called during various stages of our renderer. This is the\n * foundation on which all our addons like `preact/debug`, `preact/compat`,\n * and `preact/hooks` are based on. See the `Options` type in `internal.d.ts`\n * for a full list of available option hooks (most editors/IDEs allow you to\n * ctrl+click or cmd+click on mac the type definition below).\n * @type {import('./internal').Options}\n */\nconst options = {\n\t_catchError\n};\n\nexport default options;\n","import { slice } from './util';\nimport options from './options';\nimport { NULL, UNDEFINED } from './constants';\n\nlet vnodeId = 0;\n\n/**\n * Create an virtual node (used for JSX)\n * @param {import('./internal').VNode[\"type\"]} type The node name or Component constructor for this\n * virtual node\n * @param {object | null | undefined} [props] The properties of the virtual node\n * @param {Array<import('.').ComponentChildren>} [children] The children of the\n * virtual node\n * @returns {import('./internal').VNode}\n */\nexport function createElement(type, props, children) {\n\tlet normalizedProps = {},\n\t\tkey,\n\t\tref,\n\t\ti;\n\tfor (i in props) {\n\t\tif (i == 'key') key = props[i];\n\t\telse if (i == 'ref') ref = props[i];\n\t\telse normalizedProps[i] = props[i];\n\t}\n\n\tif (arguments.length > 2) {\n\t\tnormalizedProps.children =\n\t\t\targuments.length > 3 ? slice.call(arguments, 2) : children;\n\t}\n\n\t// If a Component VNode, check for and apply defaultProps\n\t// Note: type may be undefined in development, must never error here.\n\tif (typeof type == 'function' && type.defaultProps != NULL) {\n\t\tfor (i in type.defaultProps) {\n\t\t\tif (normalizedProps[i] === UNDEFINED) {\n\t\t\t\tnormalizedProps[i] = type.defaultProps[i];\n\t\t\t}\n\t\t}\n\t}\n\n\treturn createVNode(type, normalizedProps, key, ref, NULL);\n}\n\n/**\n * Create a VNode (used internally by Preact)\n * @param {import('./internal').VNode[\"type\"]} type The node name or Component\n * Constructor for this virtual node\n * @param {object | string | number | null} props The properties of this virtual node.\n * If this virtual node represents a text node, this is the text of the node (string or number).\n * @param {string | number | null} key The key for this virtual node, used when\n * diffing it against its children\n * @param {import('./internal').VNode[\"ref\"]} ref The ref property that will\n * receive a reference to its created child\n * @returns {import('./internal').VNode}\n */\nexport function createVNode(type, props, key, ref, original) {\n\t// V8 seems to be better at detecting type shapes if the object is allocated from the same call site\n\t// Do not inline into createElement and coerceToVNode!\n\t/** @type {import('./internal').VNode} */\n\tconst vnode = {\n\t\ttype,\n\t\tprops,\n\t\tkey,\n\t\tref,\n\t\t_children: NULL,\n\t\t_parent: NULL,\n\t\t_depth: 0,\n\t\t_dom: NULL,\n\t\t_component: NULL,\n\t\tconstructor: UNDEFINED,\n\t\t_original: original == NULL ? ++vnodeId : original,\n\t\t_index: -1,\n\t\t_flags: 0\n\t};\n\n\t// Only invoke the vnode hook if this was *not* a direct copy:\n\tif (original == NULL && options.vnode != NULL) options.vnode(vnode);\n\n\treturn vnode;\n}\n\nexport function createRef() {\n\treturn { current: NULL };\n}\n\nexport function Fragment(props) {\n\treturn props.children;\n}\n\n/**\n * Check if a the argument is a valid Preact VNode.\n * @param {*} vnode\n * @returns {vnode is VNode}\n */\nexport const isValidElement = vnode =>\n\tvnode != NULL && vnode.constructor === UNDEFINED;\n","import { assign } from './util';\nimport { diff, commitRoot } from './diff/index';\nimport options from './options';\nimport { Fragment } from './create-element';\nimport { MODE_HYDRATE, NULL } from './constants';\n\n/**\n * Base Component class. Provides `setState()` and `forceUpdate()`, which\n * trigger rendering\n * @param {object} props The initial component props\n * @param {object} context The initial context from parent components'\n * getChildContext\n */\nexport function BaseComponent(props, context) {\n\tthis.props = props;\n\tthis.context = context;\n}\n\n/**\n * Update component state and schedule a re-render.\n * @this {import('./internal').Component}\n * @param {object | ((s: object, p: object) => object)} update A hash of state\n * properties to update with new values or a function that given the current\n * state and props returns a new partial state\n * @param {() => void} [callback] A function to be called once component state is\n * updated\n */\nBaseComponent.prototype.setState = function (update, callback) {\n\t// only clone state when copying to nextState the first time.\n\tlet s;\n\tif (this._nextState != NULL && this._nextState != this.state) {\n\t\ts = this._nextState;\n\t} else {\n\t\ts = this._nextState = assign({}, this.state);\n\t}\n\n\tif (typeof update == 'function') {\n\t\t// Some libraries like `immer` mark the current state as readonly,\n\t\t// preventing us from mutating it, so we need to clone it. See #2716\n\t\tupdate = update(assign({}, s), this.props);\n\t}\n\n\tif (update) {\n\t\tassign(s, update);\n\t}\n\n\t// Skip update if updater function returned null\n\tif (update == NULL) return;\n\n\tif (this._vnode) {\n\t\tif (callback) {\n\t\t\tthis._stateCallbacks.push(callback);\n\t\t}\n\t\tenqueueRender(this);\n\t}\n};\n\n/**\n * Immediately perform a synchronous re-render of the component\n * @this {import('./internal').Component}\n * @param {() => void} [callback] A function to be called after component is\n * re-rendered\n */\nBaseComponent.prototype.forceUpdate = function (callback) {\n\tif (this._vnode) {\n\t\t// Set render mode so that we can differentiate where the render request\n\t\t// is coming from. We need this because forceUpdate should never call\n\t\t// shouldComponentUpdate\n\t\tthis._force = true;\n\t\tif (callback) this._renderCallbacks.push(callback);\n\t\tenqueueRender(this);\n\t}\n};\n\n/**\n * Accepts `props` and `state`, and returns a new Virtual DOM tree to build.\n * Virtual DOM is generally constructed via [JSX](https://jasonformat.com/wtf-is-jsx).\n * @param {object} props Props (eg: JSX attributes) received from parent\n * element/component\n * @param {object} state The component's current state\n * @param {object} context Context object, as returned by the nearest\n * ancestor's `getChildContext()`\n * @returns {ComponentChildren | void}\n */\nBaseComponent.prototype.render = Fragment;\n\n/**\n * @param {import('./internal').VNode} vnode\n * @param {number | null} [childIndex]\n */\nexport function getDomSibling(vnode, childIndex) {\n\tif (childIndex == NULL) {\n\t\t// Use childIndex==null as a signal to resume the search from the vnode's sibling\n\t\treturn vnode._parent\n\t\t\t? getDomSibling(vnode._parent, vnode._index + 1)\n\t\t\t: NULL;\n\t}\n\n\tlet sibling;\n\tfor (; childIndex < vnode._children.length; childIndex++) {\n\t\tsibling = vnode._children[childIndex];\n\n\t\tif (sibling != NULL && sibling._dom != NULL) {\n\t\t\t// Since updateParentDomPointers keeps _dom pointer correct,\n\t\t\t// we can rely on _dom to tell us if this subtree contains a\n\t\t\t// rendered DOM node, and what the first rendered DOM node is\n\t\t\treturn sibling._dom;\n\t\t}\n\t}\n\n\t// If we get here, we have not found a DOM node in this vnode's children.\n\t// We must resume from this vnode's sibling (in it's parent _children array)\n\t// Only climb up and search the parent if we aren't searching through a DOM\n\t// VNode (meaning we reached the DOM parent of the original vnode that began\n\t// the search)\n\treturn typeof vnode.type == 'function' ? getDomSibling(vnode) : NULL;\n}\n\n/**\n * Trigger in-place re-rendering of a component.\n * @param {import('./internal').Component} component The component to rerender\n */\nfunction renderComponent(component) {\n\tlet oldVNode = component._vnode,\n\t\toldDom = oldVNode._dom,\n\t\tcommitQueue = [],\n\t\trefQueue = [];\n\n\tif (component._parentDom) {\n\t\tconst newVNode = assign({}, oldVNode);\n\t\tnewVNode._original = oldVNode._original + 1;\n\t\tif (options.vnode) options.vnode(newVNode);\n\n\t\tdiff(\n\t\t\tcomponent._parentDom,\n\t\t\tnewVNode,\n\t\t\toldVNode,\n\t\t\tcomponent._globalContext,\n\t\t\tcomponent._parentDom.namespaceURI,\n\t\t\toldVNode._flags & MODE_HYDRATE ? [oldDom] : NULL,\n\t\t\tcommitQueue,\n\t\t\toldDom == NULL ? getDomSibling(oldVNode) : oldDom,\n\t\t\t!!(oldVNode._flags & MODE_HYDRATE),\n\t\t\trefQueue\n\t\t);\n\n\t\tnewVNode._original = oldVNode._original;\n\t\tnewVNode._parent._children[newVNode._index] = newVNode;\n\t\tcommitRoot(commitQueue, newVNode, refQueue);\n\t\toldVNode._dom = oldVNode._parent = null;\n\n\t\tif (newVNode._dom != oldDom) {\n\t\t\tupdateParentDomPointers(newVNode);\n\t\t}\n\t}\n}\n\n/**\n * @param {import('./internal').VNode} vnode\n */\nfunction updateParentDomPointers(vnode) {\n\tif ((vnode = vnode._parent) != NULL && vnode._component != NULL) {\n\t\tvnode._dom = vnode._component.base = NULL;\n\t\tfor (let i = 0; i < vnode._children.length; i++) {\n\t\t\tlet child = vnode._children[i];\n\t\t\tif (child != NULL && child._dom != NULL) {\n\t\t\t\tvnode._dom = vnode._component.base = child._dom;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn updateParentDomPointers(vnode);\n\t}\n}\n\n/**\n * The render queue\n * @type {Array<import('./internal').Component>}\n */\nlet rerenderQueue = [];\n\n/*\n * The value of `Component.debounce` must asynchronously invoke the passed in callback. It is\n * important that contributors to Preact can consistently reason about what calls to `setState`, etc.\n * do, and when their effects will be applied. See the links below for some further reading on designing\n * asynchronous APIs.\n * * [Designing APIs for Asynchrony](https://blog.izs.me/2013/08/designing-apis-for-asynchrony)\n * * [Callbacks synchronous and asynchronous](https://blog.ometer.com/2011/07/24/callbacks-synchronous-and-asynchronous/)\n */\n\nlet prevDebounce;\n\nconst defer =\n\ttypeof Promise == 'function'\n\t\t? Promise.prototype.then.bind(Promise.resolve())\n\t\t: setTimeout;\n\n/**\n * Enqueue a rerender of a component\n * @param {import('./internal').Component} c The component to rerender\n */\nexport function enqueueRender(c) {\n\tif (\n\t\t(!c._dirty &&\n\t\t\t(c._dirty = true) &&\n\t\t\trerenderQueue.push(c) &&\n\t\t\t!process._rerenderCount++) ||\n\t\tprevDebounce != options.debounceRendering\n\t) {\n\t\tprevDebounce = options.debounceRendering;\n\t\t(prevDebounce || defer)(process);\n\t}\n}\n\n/**\n * @param {import('./internal').Component} a\n * @param {import('./internal').Component} b\n */\nconst depthSort = (a, b) => a._vnode._depth - b._vnode._depth;\n\n/** Flush the render queue by rerendering all queued components */\nfunction process() {\n\tlet c,\n\t\tl = 1;\n\n\t// Don't update `renderCount` yet. Keep its value non-zero to prevent unnecessary\n\t// process() calls from getting scheduled while `queue` is still being consumed.\n\twhile (rerenderQueue.length) {\n\t\t// Keep the rerender queue sorted by (depth, insertion order). The queue\n\t\t// will initially be sorted on the first iteration only if it has more than 1 item.\n\t\t//\n\t\t// New items can be added to the queue e.g. when rerendering a provider, so we want to\n\t\t// keep the order from top to bottom with those new items so we can handle them in a\n\t\t// single pass\n\t\tif (rerenderQueue.length > l) {\n\t\t\trerenderQueue.sort(depthSort);\n\t\t}\n\n\t\tc = rerenderQueue.shift();\n\t\tl = rerenderQueue.length;\n\n\t\tif (c._dirty) {\n\t\t\trenderComponent(c);\n\t\t}\n\t}\n\tprocess._rerenderCount = 0;\n}\n\nprocess._rerenderCount = 0;\n","import { IS_NON_DIMENSIONAL, NULL, SVG_NAMESPACE } from '../constants';\nimport options from '../options';\n\nfunction setStyle(style, key, value) {\n\tif (key[0] == '-') {\n\t\tstyle.setProperty(key, value == NULL ? '' : value);\n\t} else if (value == NULL) {\n\t\tstyle[key] = '';\n\t} else if (typeof value != 'number' || IS_NON_DIMENSIONAL.test(key)) {\n\t\tstyle[key] = value;\n\t} else {\n\t\tstyle[key] = value + 'px';\n\t}\n}\n\nconst CAPTURE_REGEX = /(PointerCapture)$|Capture$/i;\n\n// A logical clock to solve issues like https://github.com/preactjs/preact/issues/3927.\n// When the DOM performs an event it leaves micro-ticks in between bubbling up which means that\n// an event can trigger on a newly reated DOM-node while the event bubbles up.\n//\n// Originally inspired by Vue\n// (https://github.com/vuejs/core/blob/caeb8a68811a1b0f79/packages/runtime-dom/src/modules/events.ts#L90-L101),\n// but modified to use a logical clock instead of Date.now() in case event handlers get attached\n// and events get dispatched during the same millisecond.\n//\n// The clock is incremented after each new event dispatch. This allows 1 000 000 new events\n// per second for over 280 years before the value reaches Number.MAX_SAFE_INTEGER (2**53 - 1).\nlet eventClock = 0;\n\n/**\n * Set a property value on a DOM node\n * @param {import('../internal').PreactElement} dom The DOM node to modify\n * @param {string} name The name of the property to set\n * @param {*} value The value to set the property to\n * @param {*} oldValue The old value the property had\n * @param {string} namespace Whether or not this DOM node is an SVG node or not\n */\nexport function setProperty(dom, name, value, oldValue, namespace) {\n\tlet useCapture;\n\n\to: if (name == 'style') {\n\t\tif (typeof value == 'string') {\n\t\t\tdom.style.cssText = value;\n\t\t} else {\n\t\t\tif (typeof oldValue == 'string') {\n\t\t\t\tdom.style.cssText = oldValue = '';\n\t\t\t}\n\n\t\t\tif (oldValue) {\n\t\t\t\tfor (name in oldValue) {\n\t\t\t\t\tif (!(value && name in value)) {\n\t\t\t\t\t\tsetStyle(dom.style, name, '');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (value) {\n\t\t\t\tfor (name in value) {\n\t\t\t\t\tif (!oldValue || value[name] != oldValue[name]) {\n\t\t\t\t\t\tsetStyle(dom.style, name, value[name]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t// Benchmark for comparison: https://esbench.com/bench/574c954bdb965b9a00965ac6\n\telse if (name[0] == 'o' && name[1] == 'n') {\n\t\tuseCapture = name != (name = name.replace(CAPTURE_REGEX, '$1'));\n\t\tconst lowerCaseName = name.toLowerCase();\n\n\t\t// Infer correct casing for DOM built-in events:\n\t\tif (lowerCaseName in dom || name == 'onFocusOut' || name == 'onFocusIn')\n\t\t\tname = lowerCaseName.slice(2);\n\t\telse name = name.slice(2);\n\n\t\tif (!dom._listeners) dom._listeners = {};\n\t\tdom._listeners[name + useCapture] = value;\n\n\t\tif (value) {\n\t\t\tif (!oldValue) {\n\t\t\t\tvalue._attached = eventClock;\n\t\t\t\tdom.addEventListener(\n\t\t\t\t\tname,\n\t\t\t\t\tuseCapture ? eventProxyCapture : eventProxy,\n\t\t\t\t\tuseCapture\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tvalue._attached = oldValue._attached;\n\t\t\t}\n\t\t} else {\n\t\t\tdom.removeEventListener(\n\t\t\t\tname,\n\t\t\t\tuseCapture ? eventProxyCapture : eventProxy,\n\t\t\t\tuseCapture\n\t\t\t);\n\t\t}\n\t} else {\n\t\tif (namespace == SVG_NAMESPACE) {\n\t\t\t// Normalize incorrect prop usage for SVG:\n\t\t\t// - xlink:href / xlinkHref --> href (xlink:href was removed from SVG and isn't needed)\n\t\t\t// - className --> class\n\t\t\tname = name.replace(/xlink(H|:h)/, 'h').replace(/sName$/, 's');\n\t\t} else if (\n\t\t\tname != 'width' &&\n\t\t\tname != 'height' &&\n\t\t\tname != 'href' &&\n\t\t\tname != 'list' &&\n\t\t\tname != 'form' &&\n\t\t\t// Default value in browsers is `-1` and an empty string is\n\t\t\t// cast to `0` instead\n\t\t\tname != 'tabIndex' &&\n\t\t\tname != 'download' &&\n\t\t\tname != 'rowSpan' &&\n\t\t\tname != 'colSpan' &&\n\t\t\tname != 'role' &&\n\t\t\tname != 'popover' &&\n\t\t\tname in dom\n\t\t) {\n\t\t\ttry {\n\t\t\t\tdom[name] = value == NULL ? '' : value;\n\t\t\t\t// labelled break is 1b smaller here than a return statement (sorry)\n\t\t\t\tbreak o;\n\t\t\t} catch (e) {}\n\t\t}\n\n\t\t// aria- and data- attributes have no boolean representation.\n\t\t// A `false` value is different from the attribute not being\n\t\t// present, so we can't remove it. For non-boolean aria\n\t\t// attributes we could treat false as a removal, but the\n\t\t// amount of exceptions would cost too many bytes. On top of\n\t\t// that other frameworks generally stringify `false`.\n\n\t\tif (typeof value == 'function') {\n\t\t\t// never serialize functions as attribute values\n\t\t} else if (value != NULL && (value !== false || name[4] == '-')) {\n\t\t\tdom.setAttribute(name, name == 'popover' && value == true ? '' : value);\n\t\t} else {\n\t\t\tdom.removeAttribute(name);\n\t\t}\n\t}\n}\n\n/**\n * Create an event proxy function.\n * @param {boolean} useCapture Is the event handler for the capture phase.\n * @private\n */\nfunction createEventProxy(useCapture) {\n\t/**\n\t * Proxy an event to hooked event handlers\n\t * @param {import('../internal').PreactEvent} e The event object from the browser\n\t * @private\n\t */\n\treturn function (e) {\n\t\tif (this._listeners) {\n\t\t\tconst eventHandler = this._listeners[e.type + useCapture];\n\t\t\tif (e._dispatched == NULL) {\n\t\t\t\te._dispatched = eventClock++;\n\n\t\t\t\t// When `e._dispatched` is smaller than the time when the targeted event\n\t\t\t\t// handler was attached we know we have bubbled up to an element that was added\n\t\t\t\t// during patching the DOM.\n\t\t\t} else if (e._dispatched < eventHandler._attached) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treturn eventHandler(options.event ? options.event(e) : e);\n\t\t}\n\t};\n}\n\nconst eventProxy = createEventProxy(false);\nconst eventProxyCapture = createEventProxy(true);\n","import { enqueueRender } from './component';\nimport { NULL } from './constants';\n\nexport let i = 0;\n\nexport function createContext(defaultValue) {\n\tfunction Context(props) {\n\t\tif (!this.getChildContext) {\n\t\t\t/** @type {Set<import('./internal').Component> | null} */\n\t\t\tlet subs = new Set();\n\t\t\tlet ctx = {};\n\t\t\tctx[Context._id] = this;\n\n\t\t\tthis.getChildContext = () => ctx;\n\n\t\t\tthis.componentWillUnmount = () => {\n\t\t\t\tsubs = NULL;\n\t\t\t};\n\n\t\t\tthis.shouldComponentUpdate = function (_props) {\n\t\t\t\t// @ts-expect-error even\n\t\t\t\tif (this.props.value != _props.value) {\n\t\t\t\t\tsubs.forEach(c => {\n\t\t\t\t\t\tc._force = true;\n\t\t\t\t\t\tenqueueRender(c);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tthis.sub = c => {\n\t\t\t\tsubs.add(c);\n\t\t\t\tlet old = c.componentWillUnmount;\n\t\t\t\tc.componentWillUnmount = () => {\n\t\t\t\t\tif (subs) {\n\t\t\t\t\t\tsubs.delete(c);\n\t\t\t\t\t}\n\t\t\t\t\tif (old) old.call(c);\n\t\t\t\t};\n\t\t\t};\n\t\t}\n\n\t\treturn props.children;\n\t}\n\n\tContext._id = '__cC' + i++;\n\tContext._defaultValue = defaultValue;\n\n\t/** @type {import('./internal').FunctionComponent} */\n\tContext.Consumer = (props, contextValue) => {\n\t\treturn props.children(contextValue);\n\t};\n\n\t// we could also get rid of _contextRef entirely\n\tContext.Provider =\n\t\tContext._contextRef =\n\t\tContext.Consumer.contextType =\n\t\t\tContext;\n\n\treturn Context;\n}\n","import { diff, unmount, applyRef } from './index';\nimport { createVNode, Fragment } from '../create-element';\nimport {\n\tEMPTY_OBJ,\n\tEMPTY_ARR,\n\tINSERT_VNODE,\n\tMATCHED,\n\tUNDEFINED,\n\tNULL\n} from '../constants';\nimport { isArray } from '../util';\nimport { getDomSibling } from '../component';\n\n/**\n * @typedef {import('../internal').ComponentChildren} ComponentChildren\n * @typedef {import('../internal').Component} Component\n * @typedef {import('../internal').PreactElement} PreactElement\n * @typedef {import('../internal').VNode} VNode\n */\n\n/**\n * Diff the children of a virtual node\n * @param {PreactElement} parentDom The DOM element whose children are being\n * diffed\n * @param {ComponentChildren[]} renderResult\n * @param {VNode} newParentVNode The new virtual node whose children should be\n * diff'ed against oldParentVNode\n * @param {VNode} oldParentVNode The old virtual node whose children should be\n * diff'ed against newParentVNode\n * @param {object} globalContext The current context object - modified by\n * getChildContext\n * @param {string} namespace Current namespace of the DOM node (HTML, SVG, or MathML)\n * @param {Array<PreactElement>} excessDomChildren\n * @param {Array<Component>} commitQueue List of components which have callbacks\n * to invoke in commitRoot\n * @param {PreactElement} oldDom The current attached DOM element any new dom\n * elements should be placed around. Likely `null` on first render (except when\n * hydrating). Can be a sibling DOM element when diffing Fragments that have\n * siblings. In most cases, it starts out as `oldChildren[0]._dom`.\n * @param {boolean} isHydrating Whether or not we are in hydration\n * @param {any[]} refQueue an array of elements needed to invoke refs\n */\nexport function diffChildren(\n\tparentDom,\n\trenderResult,\n\tnewParentVNode,\n\toldParentVNode,\n\tglobalContext,\n\tnamespace,\n\texcessDomChildren,\n\tcommitQueue,\n\toldDom,\n\tisHydrating,\n\trefQueue\n) {\n\tlet i,\n\t\t/** @type {VNode} */\n\t\toldVNode,\n\t\t/** @type {VNode} */\n\t\tchildVNode,\n\t\t/** @type {PreactElement} */\n\t\tnewDom,\n\t\t/** @type {PreactElement} */\n\t\tfirstChildDom;\n\n\t// This is a compression of oldParentVNode!=null && oldParentVNode != EMPTY_OBJ && oldParentVNode._children || EMPTY_ARR\n\t// as EMPTY_OBJ._children should be `undefined`.\n\t/** @type {VNode[]} */\n\tlet oldChildren = (oldParentVNode && oldParentVNode._children) || EMPTY_ARR;\n\n\tlet newChildrenLength = renderResult.length;\n\n\toldDom = constructNewChildrenArray(\n\t\tnewParentVNode,\n\t\trenderResult,\n\t\toldChildren,\n\t\toldDom,\n\t\tnewChildrenLength\n\t);\n\n\tfor (i = 0; i < newChildrenLength; i++) {\n\t\tchildVNode = newParentVNode._children[i];\n\t\tif (childVNode == NULL) continue;\n\n\t\t// At this point, constructNewChildrenArray has assigned _index to be the\n\t\t// matchingIndex for this VNode's oldVNode (or -1 if there is no oldVNode).\n\t\tif (childVNode._index == -1) {\n\t\t\toldVNode = EMPTY_OBJ;\n\t\t} else {\n\t\t\toldVNode = oldChildren[childVNode._index] || EMPTY_OBJ;\n\t\t}\n\n\t\t// Update childVNode._index to its final index\n\t\tchildVNode._index = i;\n\n\t\t// Morph the old element into the new one, but don't append it to the dom yet\n\t\tlet result = diff(\n\t\t\tparentDom,\n\t\t\tchildVNode,\n\t\t\toldVNode,\n\t\t\tglobalContext,\n\t\t\tnamespace,\n\t\t\texcessDomChildren,\n\t\t\tcommitQueue,\n\t\t\toldDom,\n\t\t\tisHydrating,\n\t\t\trefQueue\n\t\t);\n\n\t\t// Adjust DOM nodes\n\t\tnewDom = childVNode._dom;\n\t\tif (childVNode.ref && oldVNode.ref != childVNode.ref) {\n\t\t\tif (oldVNode.ref) {\n\t\t\t\tapplyRef(oldVNode.ref, NULL, childVNode);\n\t\t\t}\n\t\t\trefQueue.push(\n\t\t\t\tchildVNode.ref,\n\t\t\t\tchildVNode._component || newDom,\n\t\t\t\tchildVNode\n\t\t\t);\n\t\t}\n\n\t\tif (firstChildDom == NULL && newDom != NULL) {\n\t\t\tfirstChildDom = newDom;\n\t\t}\n\n\t\tlet shouldPlace = !!(childVNode._flags & INSERT_VNODE);\n\t\tif (shouldPlace || oldVNode._children === childVNode._children) {\n\t\t\toldDom = insert(childVNode, oldDom, parentDom, shouldPlace);\n\t\t} else if (typeof childVNode.type == 'function' && result !== UNDEFINED) {\n\t\t\toldDom = result;\n\t\t} else if (newDom) {\n\t\t\toldDom = newDom.nextSibling;\n\t\t}\n\n\t\t// Unset diffing flags\n\t\tchildVNode._flags &= ~(INSERT_VNODE | MATCHED);\n\t}\n\n\tnewParentVNode._dom = firstChildDom;\n\n\treturn oldDom;\n}\n\n/**\n * @param {VNode} newParentVNode\n * @param {ComponentChildren[]} renderResult\n * @param {VNode[]} oldChildren\n */\nfunction constructNewChildrenArray(\n\tnewParentVNode,\n\trenderResult,\n\toldChildren,\n\toldDom,\n\tnewChildrenLength\n) {\n\t/** @type {number} */\n\tlet i;\n\t/** @type {VNode} */\n\tlet childVNode;\n\t/** @type {VNode} */\n\tlet oldVNode;\n\n\tlet oldChildrenLength = oldChildren.length,\n\t\tremainingOldChildren = oldChildrenLength;\n\n\tlet skew = 0;\n\n\tnewParentVNode._children = new Array(newChildrenLength);\n\tfor (i = 0; i < newChildrenLength; i++) {\n\t\t// @ts-expect-error We are reusing the childVNode variable to hold both the\n\t\t// pre and post normalized childVNode\n\t\tchildVNode = renderResult[i];\n\n\t\tif (\n\t\t\tchildVNode == NULL ||\n\t\t\ttypeof childVNode == 'boolean' ||\n\t\t\ttypeof childVNode == 'function'\n\t\t) {\n\t\t\tnewParentVNode._children[i] = NULL;\n\t\t\tcontinue;\n\t\t}\n\t\t// If this newVNode is being reused (e.g. <div>{reuse}{reuse}</div>) in the same diff,\n\t\t// or we are rendering a component (e.g. setState) copy the oldVNodes so it can have\n\t\t// it's own DOM & etc. pointers\n\t\telse if (\n\t\t\ttypeof childVNode == 'string' ||\n\t\t\ttypeof childVNode == 'number' ||\n\t\t\t// eslint-disable-next-line valid-typeof\n\t\t\ttypeof childVNode == 'bigint' ||\n\t\t\tchildVNode.constructor == String\n\t\t) {\n\t\t\tchildVNode = newParentVNode._children[i] = createVNode(\n\t\t\t\tNULL,\n\t\t\t\tchildVNode,\n\t\t\t\tNULL,\n\t\t\t\tNULL,\n\t\t\t\tNULL\n\t\t\t);\n\t\t} else if (isArray(childVNode)) {\n\t\t\tchildVNode = newParentVNode._children[i] = createVNode(\n\t\t\t\tFragment,\n\t\t\t\t{ children: childVNode },\n\t\t\t\tNULL,\n\t\t\t\tNULL,\n\t\t\t\tNULL\n\t\t\t);\n\t\t} else if (childVNode.constructor === UNDEFINED && childVNode._depth > 0) {\n\t\t\t// VNode is already in use, clone it. This can happen in the following\n\t\t\t// scenario:\n\t\t\t// const reuse = <div />\n\t\t\t// <div>{reuse}<span />{reuse}</div>\n\t\t\tchildVNode = newParentVNode._children[i] = createVNode(\n\t\t\t\tchildVNode.type,\n\t\t\t\tchildVNode.props,\n\t\t\t\tchildVNode.key,\n\t\t\t\tchildVNode.ref ? childVNode.ref : NULL,\n\t\t\t\tchildVNode._original\n\t\t\t);\n\t\t} else {\n\t\t\tnewParentVNode._children[i] = childVNode;\n\t\t}\n\n\t\tconst skewedIndex = i + skew;\n\t\tchildVNode._parent = newParentVNode;\n\t\tchildVNode._depth = newParentVNode._depth + 1;\n\n\t\t// Temporarily store the matchingIndex on the _index property so we can pull\n\t\t// out the oldVNode in diffChildren. We'll override this to the VNode's\n\t\t// final index after using this property to get the oldVNode\n\t\tconst matchingIndex = (childVNode._index = findMatchingIndex(\n\t\t\tchildVNode,\n\t\t\toldChildren,\n\t\t\tskewedIndex,\n\t\t\tremainingOldChildren\n\t\t));\n\n\t\toldVNode = NULL;\n\t\tif (matchingIndex != -1) {\n\t\t\toldVNode = oldChildren[matchingIndex];\n\t\t\tremainingOldChildren--;\n\t\t\tif (oldVNode) {\n\t\t\t\toldVNode._flags |= MATCHED;\n\t\t\t}\n\t\t}\n\n\t\t// Here, we define isMounting for the purposes of the skew diffing\n\t\t// algorithm. Nodes that are unsuspending are considered mounting and we detect\n\t\t// this by checking if oldVNode._original == null\n\t\tconst isMounting = oldVNode == NULL || oldVNode._original == NULL;\n\n\t\tif (isMounting) {\n\t\t\tif (matchingIndex == -1) {\n\t\t\t\t// When the array of children is growing we need to decrease the skew\n\t\t\t\t// as we are adding a new element to the array.\n\t\t\t\t// Example:\n\t\t\t\t// [1, 2, 3] --> [0, 1, 2, 3]\n\t\t\t\t// oldChildren newChildren\n\t\t\t\t//\n\t\t\t\t// The new element is at index 0, so our skew is 0,\n\t\t\t\t// we need to decrease the skew as we are adding a new element.\n\t\t\t\t// The decrease will cause us to compare the element at position 1\n\t\t\t\t// with value 1 with the element at position 0 with value 0.\n\t\t\t\t//\n\t\t\t\t// A linear concept is applied when the array is shrinking,\n\t\t\t\t// if the length is unchanged we can assume that no skew\n\t\t\t\t// changes are needed.\n\t\t\t\tif (newChildrenLength > oldChildrenLength) {\n\t\t\t\t\tskew--;\n\t\t\t\t} else if (newChildrenLength < oldChildrenLength) {\n\t\t\t\t\tskew++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// If we are mounting a DOM VNode, mark it for insertion\n\t\t\tif (typeof childVNode.type != 'function') {\n\t\t\t\tchildVNode._flags |= INSERT_VNODE;\n\t\t\t}\n\t\t} else if (matchingIndex != skewedIndex) {\n\t\t\t// When we move elements around i.e. [0, 1, 2] --> [1, 0, 2]\n\t\t\t// --> we diff 1, we find it at position 1 while our skewed index is 0 and our skew is 0\n\t\t\t// we set the skew to 1 as we found an offset.\n\t\t\t// --> we diff 0, we find it at position 0 while our skewed index is at 2 and our skew is 1\n\t\t\t// this makes us increase the skew again.\n\t\t\t// --> we diff 2, we find it at position 2 while our skewed index is at 4 and our skew is 2\n\t\t\t//\n\t\t\t// this becomes an optimization question where currently we see a 1 element offset as an insertion\n\t\t\t// or deletion i.e. we optimize for [0, 1, 2] --> [9, 0, 1, 2]\n\t\t\t// while a more than 1 offset we see as a swap.\n\t\t\t// We could probably build heuristics for having an optimized course of action here as well, but\n\t\t\t// might go at the cost of some bytes.\n\t\t\t//\n\t\t\t// If we wanted to optimize for i.e. only swaps we'd just do the last two code-branches and have\n\t\t\t// only the first item be a re-scouting and all the others fall in their skewed counter-part.\n\t\t\t// We could also further optimize for swaps\n\t\t\tif (matchingIndex == skewedIndex - 1) {\n\t\t\t\tskew--;\n\t\t\t} else if (matchingIndex == skewedIndex + 1) {\n\t\t\t\tskew++;\n\t\t\t} else {\n\t\t\t\tif (matchingIndex > skewedIndex) {\n\t\t\t\t\tskew--;\n\t\t\t\t} else {\n\t\t\t\t\tskew++;\n\t\t\t\t}\n\n\t\t\t\t// Move this VNode's DOM if the original index (matchingIndex) doesn't\n\t\t\t\t// match the new skew index (i + new skew)\n\t\t\t\t// In the former two branches we know that it matches after skewing\n\t\t\t\tchildVNode._flags |= INSERT_VNODE;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Remove remaining oldChildren if there are any. Loop forwards so that as we\n\t// unmount DOM from the beginning of the oldChildren, we can adjust oldDom to\n\t// point to the next child, which needs to be the first DOM node that won't be\n\t// unmounted.\n\tif (remainingOldChildren) {\n\t\tfor (i = 0; i < oldChildrenLength; i++) {\n\t\t\toldVNode = oldChildren[i];\n\t\t\tif (oldVNode != NULL && (oldVNode._flags & MATCHED) == 0) {\n\t\t\t\tif (oldVNode._dom == oldDom) {\n\t\t\t\t\toldDom = getDomSibling(oldVNode);\n\t\t\t\t}\n\n\t\t\t\tunmount(oldVNode, oldVNode);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn oldDom;\n}\n\n/**\n * @param {VNode} parentVNode\n * @param {PreactElement} oldDom\n * @param {PreactElement} parentDom\n * @param {boolean} shouldPlace\n * @returns {PreactElement}\n */\nfunction insert(parentVNode, oldDom, parentDom, shouldPlace) {\n\t// Note: VNodes in nested suspended trees may be missing _children.\n\n\tif (typeof parentVNode.type == 'function') {\n\t\tlet children = parentVNode._children;\n\t\tfor (let i = 0; children && i < children.length; i++) {\n\t\t\tif (children[i]) {\n\t\t\t\t// If we enter this code path on sCU bailout, where we copy\n\t\t\t\t// oldVNode._children to newVNode._children, we need to update the old\n\t\t\t\t// children's _parent pointer to point to the newVNode (parentVNode\n\t\t\t\t// here).\n\t\t\t\tchildren[i]._parent = parentVNode;\n\t\t\t\toldDom = insert(children[i], oldDom, parentDom, shouldPlace);\n\t\t\t}\n\t\t}\n\n\t\treturn oldDom;\n\t} else if (parentVNode._dom != oldDom) {\n\t\tif (shouldPlace) {\n\t\t\tif (oldDom && parentVNode.type && !oldDom.parentNode) {\n\t\t\t\toldDom = getDomSibling(parentVNode);\n\t\t\t}\n\t\t\tparentDom.insertBefore(parentVNode._dom, oldDom || NULL);\n\t\t}\n\t\toldDom = parentVNode._dom;\n\t}\n\n\tdo {\n\t\toldDom = oldDom && oldDom.nextSibling;\n\t} while (oldDom != NULL && oldDom.nodeType == 8);\n\n\treturn oldDom;\n}\n\n/**\n * Flatten and loop through the children of a virtual node\n * @param {ComponentChildren} children The unflattened children of a virtual\n * node\n * @returns {VNode[]}\n */\nexport function toChildArray(children, out) {\n\tout = out || [];\n\tif (children == NULL || typeof children == 'boolean') {\n\t} else if (isArray(children)) {\n\t\tchildren.some(child => {\n\t\t\ttoChildArray(child, out);\n\t\t});\n\t} else {\n\t\tout.push(children);\n\t}\n\treturn out;\n}\n\n/**\n * @param {VNode} childVNode\n * @param {VNode[]} oldChildren\n * @param {number} skewedIndex\n * @param {number} remainingOldChildren\n * @returns {number}\n */\nfunction findMatchingIndex(\n\tchildVNode,\n\toldChildren,\n\tskewedIndex,\n\tremainingOldChildren\n) {\n\tconst key = childVNode.key;\n\tconst type = childVNode.type;\n\tlet oldVNode = oldChildren[skewedIndex];\n\tconst matched = oldVNode != NULL && (oldVNode._flags & MATCHED) == 0;\n\n\t// We only need to perform a search if there are more children\n\t// (remainingOldChildren) to search. However, if the oldVNode we just looked\n\t// at skewedIndex was not already used in this diff, then there must be at\n\t// least 1 other (so greater than 1) remainingOldChildren to attempt to match\n\t// against. So the following condition checks that ensuring\n\t// remainingOldChildren > 1 if the oldVNode is not already used/matched. Else\n\t// if the oldVNode was null or matched, then there could needs to be at least\n\t// 1 (aka `remainingOldChildren > 0`) children to find and compare against.\n\t//\n\t// If there is an unkeyed functional VNode, that isn't a built-in like our Fragment,\n\t// we should not search as we risk re-using state of an unrelated VNode. (reverted for now)\n\tlet shouldSearch =\n\t\t// (typeof type != 'function' || type === Fragment || key) &&\n\t\tremainingOldChildren > (matched ? 1 : 0);\n\n\tif (\n\t\t(oldVNode === NULL && key == null) ||\n\t\t(matched && key == oldVNode.key && type == oldVNode.type)\n\t) {\n\t\treturn skewedIndex;\n\t} else if (shouldSearch) {\n\t\tlet x = skewedIndex - 1;\n\t\tlet y = skewedIndex + 1;\n\t\twhile (x >= 0 || y < oldChildren.length) {\n\t\t\tconst childIndex = x >= 0 ? x-- : y++;\n\t\t\toldVNode = oldChildren[childIndex];\n\t\t\tif (\n\t\t\t\toldVNode != NULL &&\n\t\t\t\t(oldVNode._flags & MATCHED) == 0 &&\n\t\t\t\tkey == oldVNode.key &&\n\t\t\t\ttype == oldVNode.type\n\t\t\t) {\n\t\t\t\treturn childIndex;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn -1;\n}\n","import {\n\tEMPTY_OBJ,\n\tMATH_NAMESPACE,\n\tMODE_HYDRATE,\n\tMODE_SUSPENDED,\n\tNULL,\n\tRESET_MODE,\n\tSVG_NAMESPACE,\n\tUNDEFINED,\n\tXHTML_NAMESPACE\n} from '../constants';\nimport { BaseComponent, getDomSibling } from '../component';\nimport { Fragment } from '../create-element';\nimport { diffChildren } from './children';\nimport { setProperty } from './props';\nimport { assign, isArray, removeNode, slice } from '../util';\nimport options from '../options';\n\n/**\n * @typedef {import('../internal').ComponentChildren} ComponentChildren\n * @typedef {import('../internal').Component} Component\n * @typedef {import('../internal').PreactElement} PreactElement\n * @typedef {import('../internal').VNode} VNode\n */\n\n/**\n * @template {any} T\n * @typedef {import('../internal').Ref<T>} Ref<T>\n */\n\n/**\n * Diff two virtual nodes and apply proper changes to the DOM\n * @param {PreactElement} parentDom The parent of the DOM element\n * @param {VNode} newVNode The new virtual node\n * @param {VNode} oldVNode The old virtual node\n * @param {object} globalContext The current context object. Modified by\n * getChildContext\n * @param {string} namespace Current namespace of the DOM node (HTML, SVG, or MathML)\n * @param {Array<PreactElement>} excessDomChildren\n * @param {Array<Component>} commitQueue List of components which have callbacks\n * to invoke in commitRoot\n * @param {PreactElement} oldDom The current attached DOM element any new dom\n * elements should be placed around. Likely `null` on first render (except when\n * hydrating). Can be a sibling DOM element when diffing Fragments that have\n * siblings. In most cases, it starts out as `oldChildren[0]._dom`.\n * @param {boolean} isHydrating Whether or not we are in hydration\n * @param {any[]} refQueue an array of elements needed to invoke refs\n */\nexport function diff(\n\tparentDom,\n\tnewVNode,\n\toldVNode,\n\tglobalContext,\n\tnamespace,\n\texcessDomChildren,\n\tcommitQueue,\n\toldDom,\n\tisHydrating,\n\trefQueue\n) {\n\t/** @type {any} */\n\tlet tmp,\n\t\tnewType = newVNode.type;\n\n\t// When passing through createElement it assigns the object\n\t// constructor as undefined. This to prevent JSON-injection.\n\tif (newVNode.constructor !== UNDEFINED) return NULL;\n\n\t// If the previous diff bailed out, resume creating/hydrating.\n\tif (oldVNode._flags & MODE_SUSPENDED) {\n\t\tisHydrating = !!(oldVNode._flags & MODE_HYDRATE);\n\t\toldDom = newVNode._dom = oldVNode._dom;\n\t\texcessDomChildren = [oldDom];\n\t}\n\n\tif ((tmp = options._diff)) tmp(newVNode);\n\n\touter: if (typeof newType == 'function') {\n\t\ttry {\n\t\t\tlet c, isNew, oldProps, oldState, snapshot, clearProcessingException;\n\t\t\tlet newProps = newVNode.props;\n\t\t\tconst isClassComponent =\n\t\t\t\t'prototype' in newType && newType.prototype.render;\n\n\t\t\t// Necessary for createContext api. Setting this property will pass\n\t\t\t// the context value as `this.context` just for this component.\n\t\t\ttmp = newType.contextType;\n\t\t\tlet provider = tmp && globalContext[tmp._id];\n\t\t\tlet componentContext = tmp\n\t\t\t\t? provider\n\t\t\t\t\t? provider.props.value\n\t\t\t\t\t: tmp._defaultValue\n\t\t\t\t: globalContext;\n\n\t\t\t// Get component and set it to `c`\n\t\t\tif (oldVNode._component) {\n\t\t\t\tc = newVNode._component = oldVNode._component;\n\t\t\t\tclearProcessingException = c._processingException = c._pendingError;\n\t\t\t} else {\n\t\t\t\t// Instantiate the new component\n\t\t\t\tif (isClassComponent) {\n\t\t\t\t\t// @ts-expect-error The check above verifies that newType is suppose to be constructed\n\t\t\t\t\tnewVNode._component = c = new newType(newProps, componentContext); // eslint-disable-line new-cap\n\t\t\t\t} else {\n\t\t\t\t\t// @ts-expect-error Trust me, Component implements the interface we want\n\t\t\t\t\tnewVNode._component = c = new BaseComponent(\n\t\t\t\t\t\tnewProps,\n\t\t\t\t\t\tcomponentContext\n\t\t\t\t\t);\n\t\t\t\t\tc.constructor = newType;\n\t\t\t\t\tc.render = doRender;\n\t\t\t\t}\n\t\t\t\tif (provider) provider.sub(c);\n\n\t\t\t\tif (!c.state) c.state = {};\n\t\t\t\tc._globalContext = globalContext;\n\t\t\t\tisNew = c._dirty = true;\n\t\t\t\tc._renderCallbacks = [];\n\t\t\t\tc._stateCallbacks = [];\n\t\t\t}\n\n\t\t\t// Invoke getDerivedStateFromProps\n\t\t\tif (isClassComponent && c._nextState == NULL) {\n\t\t\t\tc._nextState = c.state;\n\t\t\t}\n\n\t\t\tif (isClassComponent && newType.getDerivedStateFromProps != NULL) {\n\t\t\t\tif (c._nextState == c.state) {\n\t\t\t\t\tc._nextState = assign({}, c._nextState);\n\t\t\t\t}\n\n\t\t\t\tassign(\n\t\t\t\t\tc._nextState,\n\t\t\t\t\tnewType.getDerivedStateFromProps(newProps, c._nextState)\n\t\t\t\t);\n\t\t\t}\n\n\t\t\toldProps = c.props;\n\t\t\toldState = c.state;\n\t\t\tc._vnode = newVNode;\n\n\t\t\t// Invoke pre-render lifecycle methods\n\t\t\tif (isNew) {\n\t\t\t\tif (\n\t\t\t\t\tisClassComponent &&\n\t\t\t\t\tnewType.getDerivedStateFromProps == NULL &&\n\t\t\t\t\tc.componentWillMount != NULL\n\t\t\t\t) {\n\t\t\t\t\tc.componentWillMount();\n\t\t\t\t}\n\n\t\t\t\tif (isClassComponent && c.componentDidMount != NULL) {\n\t\t\t\t\tc._renderCallbacks.push(c.componentDidMount);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (\n\t\t\t\t\tisClassComponent &&\n\t\t\t\t\tnewType.getDerivedStateFromProps == NULL &&\n\t\t\t\t\tnewProps !== oldProps &&\n\t\t\t\t\tc.componentWillReceiveProps != NULL\n\t\t\t\t) {\n\t\t\t\t\tc.componentWillReceiveProps(newProps, componentContext);\n\t\t\t\t}\n\n\t\t\t\tif (\n\t\t\t\t\tnewVNode._original == oldVNode._original ||\n\t\t\t\t\t(!c._force &&\n\t\t\t\t\t\tc.shouldComponentUpdate != NULL &&\n\t\t\t\t\t\tc.shouldComponentUpdate(\n\t\t\t\t\t\t\tnewProps,\n\t\t\t\t\t\t\tc._nextState,\n\t\t\t\t\t\t\tcomponentContext\n\t\t\t\t\t\t) === false)\n\t\t\t\t) {\n\t\t\t\t\t// More info about this here: https://gist.github.com/JoviDeCroock/bec5f2ce93544d2e6070ef8e0036e4e8\n\t\t\t\t\tif (newVNode._original != oldVNode._original) {\n\t\t\t\t\t\t// When we are dealing with a bail because of sCU we have to update\n\t\t\t\t\t\t// the props, state and dirty-state.\n\t\t\t\t\t\t// when we are dealing with strict-equality we don't as the child could still\n\t\t\t\t\t\t// be dirtied see #3883\n\t\t\t\t\t\tc.props = newProps;\n\t\t\t\t\t\tc.state = c._nextState;\n\t\t\t\t\t\tc._dirty = false;\n\t\t\t\t\t}\n\n\t\t\t\t\tnewVNode._dom = oldVNode._dom;\n\t\t\t\t\tnewVNode._children = oldVNode._children;\n\t\t\t\t\tnewVNode._children.some(vnode => {\n\t\t\t\t\t\tif (vnode) vnode._parent = newVNode;\n\t\t\t\t\t});\n\n\t\t\t\t\tfor (let i = 0; i < c._stateCallbacks.length; i++) {\n\t\t\t\t\t\tc._renderCallbacks.push(c._stateCallbacks[i]);\n\t\t\t\t\t}\n\t\t\t\t\tc._stateCallbacks = [];\n\n\t\t\t\t\tif (c._renderCallbacks.length) {\n\t\t\t\t\t\tcommitQueue.push(c);\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak outer;\n\t\t\t\t}\n\n\t\t\t\tif (c.componentWillUpdate != NULL) {\n\t\t\t\t\tc.componentWillUpdate(newProps, c._nextState, componentContext);\n\t\t\t\t}\n\n\t\t\t\tif (isClassComponent && c.componentDidUpdate != NULL) {\n\t\t\t\t\tc._renderCallbacks.push(() => {\n\t\t\t\t\t\tc.componentDidUpdate(oldProps, oldState, snapshot);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tc.context = componentContext;\n\t\t\tc.props = newProps;\n\t\t\tc._parentDom = parentDom;\n\t\t\tc._force = false;\n\n\t\t\tlet renderHook = options._render,\n\t\t\t\tcount = 0;\n\t\t\tif (isClassComponent) {\n\t\t\t\tc.state = c._nextState;\n\t\t\t\tc._dirty = false;\n\n\t\t\t\tif (renderHook) renderHook(newVNode);\n\n\t\t\t\ttmp = c.render(c.props, c.state, c.context);\n\n\t\t\t\tfor (let i = 0; i < c._stateCallbacks.length; i++) {\n\t\t\t\t\tc._renderCallbacks.push(c._stateCallbacks[i]);\n\t\t\t\t}\n\t\t\t\tc._stateCallbacks = [];\n\t\t\t} else {\n\t\t\t\tdo {\n\t\t\t\t\tc._dirty = false;\n\t\t\t\t\tif (renderHook) renderHook(newVNode);\n\n\t\t\t\t\ttmp = c.render(c.props, c.state, c.context);\n\n\t\t\t\t\t// Handle setState called in render, see #2553\n\t\t\t\t\tc.state = c._nextState;\n\t\t\t\t} while (c._dirty && ++count < 25);\n\t\t\t}\n\n\t\t\t// Handle setState called in render, see #2553\n\t\t\tc.state = c._nextState;\n\n\t\t\tif (c.getChildContext != NULL) {\n\t\t\t\tglobalContext = assign(assign({}, globalContext), c.getChildContext());\n\t\t\t}\n\n\t\t\tif (isClassComponent && !isNew && c.getSnapshotBeforeUpdate != NULL) {\n\t\t\t\tsnapshot = c.getSnapshotBeforeUpdate(oldProps, oldState);\n\t\t\t}\n\n\t\t\tlet isTopLevelFragment =\n\t\t\t\ttmp != NULL && tmp.type === Fragment && tmp.key == NULL;\n\t\t\tlet renderResult = tmp;\n\n\t\t\tif (isTopLevelFragment) {\n\t\t\t\trenderResult = cloneNode(tmp.props.children);\n\t\t\t}\n\n\t\t\toldDom = diffChildren(\n\t\t\t\tparentDom,\n\t\t\t\tisArray(renderResult) ? renderResult : [renderResult],\n\t\t\t\tnewVNode,\n\t\t\t\toldVNode,\n\t\t\t\tglobalContext,\n\t\t\t\tnamespace,\n\t\t\t\texcessDomChildren,\n\t\t\t\tcommitQueue,\n\t\t\t\toldDom,\n\t\t\t\tisHydrating,\n\t\t\t\trefQueue\n\t\t\t);\n\n\t\t\tc.base = newVNode._dom;\n\n\t\t\t// We successfully rendered this VNode, unset any stored hydration/bailout state:\n\t\t\tnewVNode._flags &= RESET_MODE;\n\n\t\t\tif (c._renderCallbacks.length) {\n\t\t\t\tcommitQueue.push(c);\n\t\t\t}\n\n\t\t\tif (clearProcessingException) {\n\t\t\t\tc._pendingError = c._processingException = NULL;\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tnewVNode._original = NULL;\n\t\t\t// if hydrating or creating initial tree, bailout preserves DOM:\n\t\t\tif (isHydrating || excessDomChildren != NULL) {\n\t\t\t\tif (e.then) {\n\t\t\t\t\tnewVNode._flags |= isHydrating\n\t\t\t\t\t\t? MODE_HYDRATE | MODE_SUSPENDED\n\t\t\t\t\t\t: MODE_SUSPENDED;\n\n\t\t\t\t\twhile (oldDom && oldDom.nodeType == 8 && oldDom.nextSibling) {\n\t\t\t\t\t\toldDom = oldDom.nextSibling;\n\t\t\t\t\t}\n\n\t\t\t\t\texcessDomChildren[excessDomChildren.indexOf(oldDom)] = NULL;\n\t\t\t\t\tnewVNode._dom = oldDom;\n\t\t\t\t} else {\n\t\t\t\t\tfor (let i = excessDomChildren.length; i--; ) {\n\t\t\t\t\t\tremoveNode(excessDomChildren[i]);\n\t\t\t\t\t}\n\t\t\t\t\tmarkAsForce(newVNode);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tnewVNode._dom = oldVNode._dom;\n\t\t\t\tnewVNode._children = oldVNode._children;\n\t\t\t\tif (!e.then) markAsForce(newVNode);\n\t\t\t}\n\t\t\toptions._catchError(e, newVNode, oldVNode);\n\t\t}\n\t} else if (\n\t\texcessDomChildren == NULL &&\n\t\tnewVNode._original == oldVNode._original\n\t) {\n\t\tnewVNode._children = oldVNode._children;\n\t\tnewVNode._dom = oldVNode._dom;\n\t} else {\n\t\toldDom = newVNode._dom = diffElementNodes(\n\t\t\toldVNode._dom,\n\t\t\tnewVNode,\n\t\t\toldVNode,\n\t\t\tglobalContext,\n\t\t\tnamespace,\n\t\t\texcessDomChildren,\n\t\t\tcommitQueue,\n\t\t\tisHydrating,\n\t\t\trefQueue\n\t\t);\n\t}\n\n\tif ((tmp = options.diffed)) tmp(newVNode);\n\n\treturn newVNode._flags & MODE_SUSPENDED ? undefined : oldDom;\n}\n\nfunction markAsForce(vnode) {\n\tif (vnode && vnode._component) vnode._component._force = true;\n\tif (vnode && vnode._children) vnode._children.forEach(markAsForce);\n}\n\n/**\n * @param {Array<Component>} commitQueue List of components\n * which have callbacks to invoke in commitRoot\n * @param {VNode} root\n */\nexport function commitRoot(commitQueue, root, refQueue) {\n\tfor (let i = 0; i < refQueue.length; i++) {\n\t\tapplyRef(refQueue[i], refQueue[++i], refQueue[++i]);\n\t}\n\n\tif (options._commit) options._commit(root, commitQueue);\n\n\tcommitQueue.some(c => {\n\t\ttry {\n\t\t\t// @ts-expect-error Reuse the commitQueue variable here so the type changes\n\t\t\tcommitQueue = c._renderCallbacks;\n\t\t\tc._renderCallbacks = [];\n\t\t\tcommitQueue.some(cb => {\n\t\t\t\t// @ts-expect-error See above comment on commitQueue\n\t\t\t\tcb.call(c);\n\t\t\t});\n\t\t} catch (e) {\n\t\t\toptions._catchError(e, c._vnode);\n\t\t}\n\t});\n}\n\nfunction cloneNode(node) {\n\tif (\n\t\ttypeof node != 'object' ||\n\t\tnode == NULL ||\n\t\t(node._depth && node._depth > 0)\n\t) {\n\t\treturn node;\n\t}\n\n\tif (isArray(node)) {\n\t\treturn node.map(cloneNode);\n\t}\n\n\treturn assign({}, node);\n}\n\n/**\n * Diff two virtual nodes representing DOM element\n * @param {PreactElement} dom The DOM element representing the virtual nodes\n * being diffed\n * @param {VNode} newVNode The new virtual node\n * @param {VNode} oldVNode The old virtual node\n * @param {object} globalContext The current context object\n * @param {string} namespace Current namespace of the DOM node (HTML, SVG, or MathML)\n * @param {Array<PreactElement>} excessDomChildren\n * @param {Array<Component>} commitQueue List of components which have callbacks\n * to invoke in commitRoot\n * @param {boolean} isHydrating Whether or not we are in hydration\n * @param {any[]} refQueue an array of elements needed to invoke refs\n * @returns {PreactElement}\n */\nfunction diffElementNodes(\n\tdom,\n\tnewVNode,\n\toldVNode,\n\tglobalContext,\n\tnamespace,\n\texcessDomChildren,\n\tcommitQueue,\n\tisHydrating,\n\trefQueue\n) {\n\tlet oldProps = oldVNode.props || EMPTY_OBJ;\n\tlet newProps = newVNode.props;\n\tlet nodeType = /** @type {string} */ (newVNode.type);\n\t/** @type {any} */\n\tlet i;\n\t/** @type {{ __html?: string }} */\n\tlet newHtml;\n\t/** @type {{ __html?: string }} */\n\tlet oldHtml;\n\t/** @type {ComponentChildren} */\n\tlet newChildren;\n\tlet value;\n\tlet inputValue;\n\tlet checked;\n\n\t// Tracks entering and exiting namespaces when descending through the tree.\n\tif (nodeType == 'svg') namespace = SVG_NAMESPACE;\n\telse if (nodeType == 'math') namespace = MATH_NAMESPACE;\n\telse if (!namespace) namespace = XHTML_NAMESPACE;\n\n\tif (excessDomChildren != NULL) {\n\t\tfor (i = 0; i < excessDomChildren.length; i++) {\n\t\t\tvalue = excessDomChildren[i];\n\n\t\t\t// if newVNode matches an element in excessDomChildren or the `dom`\n\t\t\t// argument matches an element in excessDomChildren, remove it from\n\t\t\t// excessDomChildren so it isn't later removed in diffChildren\n\t\t\tif (\n\t\t\t\tvalue &&\n\t\t\t\t'setAttribute' in value == !!nodeType &&\n\t\t\t\t(nodeType ? value.localName == nodeType : value.nodeType == 3)\n\t\t\t) {\n\t\t\t\tdom = value;\n\t\t\t\texcessDomChildren[i] = NULL;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (dom == NULL) {\n\t\tif (nodeType == NULL) {\n\t\t\treturn document.createTextNode(newProps);\n\t\t}\n\n\t\tdom = document.createElementNS(\n\t\t\tnamespace,\n\t\t\tnodeType,\n\t\t\tnewProps.is && newProps\n\t\t);\n\n\t\t// we are creating a new node, so we can assume this is a new subtree (in\n\t\t// case we are hydrating), this deopts the hydrate\n\t\tif (isHydrating) {\n\t\t\tif (options._hydrationMismatch)\n\t\t\t\toptions._hydrationMismatch(newVNode, excessDomChildren);\n\t\t\tisHydrating = false;\n\t\t}\n\t\t// we created a new parent, so none of the previously attached children can be reused:\n\t\texcessDomChildren = NULL;\n\t}\n\n\tif (nodeType == NULL) {\n\t\t// During hydration, we still have to split merged text from SSR'd HTML.\n\t\tif (oldProps !== newProps && (!isHydrating || dom.data != newProps)) {\n\t\t\tdom.data = newProps;\n\t\t}\n\t} else {\n\t\t// If excessDomChildren was not null, repopulate it with the current element's children:\n\t\texcessDomChildren = excessDomChildren && slice.call(dom.childNodes);\n\n\t\t// If we are in a situation where we are not hydrating but are using\n\t\t// existing DOM (e.g. replaceNode) we should read the existing DOM\n\t\t// attributes to diff them\n\t\tif (!isHydrating && excessDomChildren != NULL) {\n\t\t\toldProps = {};\n\t\t\tfor (i = 0; i < dom.attributes.length; i++) {\n\t\t\t\tvalue = dom.attributes[i];\n\t\t\t\toldProps[value.name] = value.value;\n\t\t\t}\n\t\t}\n\n\t\tfor (i in oldProps) {\n\t\t\tvalue = oldProps[i];\n\t\t\tif (i == 'children') {\n\t\t\t} else if (i == 'dangerouslySetInnerHTML') {\n\t\t\t\toldHtml = value;\n\t\t\t} else if (!(i in newProps)) {\n\t\t\t\tif (\n\t\t\t\t\t(i == 'value' && 'defaultValue' in newProps) ||\n\t\t\t\t\t(i == 'checked' && 'defaultChecked' in newProps)\n\t\t\t\t) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tsetProperty(dom, i, NULL, value, namespace);\n\t\t\t}\n\t\t}\n\n\t\t// During hydration, props are not diffed at all (including dangerouslySetInnerHTML)\n\t\t// @TODO we should warn in debug mode when props don't match here.\n\t\tfor (i in newProps) {\n\t\t\tvalue = newProps[i];\n\t\t\tif (i == 'children') {\n\t\t\t\tnewChildren = value;\n\t\t\t} else if (i == 'dangerouslySetInnerHTML') {\n\t\t\t\tnewHtml = value;\n\t\t\t} else if (i == 'value') {\n\t\t\t\tinputValue = value;\n\t\t\t} else if (i == 'checked') {\n\t\t\t\tchecked = value;\n\t\t\t} else if (\n\t\t\t\t(!isHydrating || typeof value == 'function') &&\n\t\t\t\toldProps[i] !== value\n\t\t\t) {\n\t\t\t\tsetProperty(dom, i, value, oldProps[i], namespace);\n\t\t\t}\n\t\t}\n\n\t\t// If the new vnode didn't have dangerouslySetInnerHTML, diff its children\n\t\tif (newHtml) {\n\t\t\t// Avoid re-applying the same '__html' if it did not changed between re-render\n\t\t\tif (\n\t\t\t\t!isHydrating &&\n\t\t\t\t(!oldHtml ||\n\t\t\t\t\t(newHtml.__html != oldHtml.__html && newHtml.__html != dom.innerHTML))\n\t\t\t) {\n\t\t\t\tdom.innerHTML = newHtml.__html;\n\t\t\t}\n\n\t\t\tnewVNode._children = [];\n\t\t} else {\n\t\t\tif (oldHtml) dom.innerHTML = '';\n\n\t\t\tdiffChildren(\n\t\t\t\t// @ts-expect-error\n\t\t\t\tnewVNode.type == 'template' ? dom.content : dom,\n\t\t\t\tisArray(newChildren) ? newChildren : [newChildren],\n\t\t\t\tnewVNode,\n\t\t\t\toldVNode,\n\t\t\t\tglobalContext,\n\t\t\t\tnodeType == 'foreignObject' ? XHTML_NAMESPACE : namespace,\n\t\t\t\texcessDomChildren,\n\t\t\t\tcommitQueue,\n\t\t\t\texcessDomChildren\n\t\t\t\t\t? excessDomChildren[0]\n\t\t\t\t\t: oldVNode._children && getDomSibling(oldVNode, 0),\n\t\t\t\tisHydrating,\n\t\t\t\trefQueue\n\t\t\t);\n\n\t\t\t// Remove children that are not part of any vnode.\n\t\t\tif (excessDomChildren != NULL) {\n\t\t\t\tfor (i = excessDomChildren.length; i--; ) {\n\t\t\t\t\tremoveNode(excessDomChildren[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// As above, don't diff props during hydration\n\t\tif (!isHydrating) {\n\t\t\ti = 'value';\n\t\t\tif (nodeType == 'progress' && inputValue == NULL) {\n\t\t\t\tdom.removeAttribute('value');\n\t\t\t} else if (\n\t\t\t\tinputValue != UNDEFINED &&\n\t\t\t\t// #2756 For the <progress>-element the initial value is 0,\n\t\t\t\t// despite the attribute not being present. When the attribute\n\t\t\t\t// is missing the progress bar is treated as indeterminate.\n\t\t\t\t// To fix that we'll always update it when it is 0 for progress elements\n\t\t\t\t(inputValue !== dom[i] ||\n\t\t\t\t\t(nodeType == 'progress' && !inputValue) ||\n\t\t\t\t\t// This is only for IE 11 to fix <select> value not being updated.\n\t\t\t\t\t// To avoid a stale select value we need to set the option.value\n\t\t\t\t\t// again, which triggers IE11 to re-evaluate the select value\n\t\t\t\t\t(nodeType == 'option' && inputValue != oldProps[i]))\n\t\t\t) {\n\t\t\t\tsetProperty(dom, i, inputValue, oldProps[i], namespace);\n\t\t\t}\n\n\t\t\ti = 'checked';\n\t\t\tif (checked != UNDEFINED && checked != dom[i]) {\n\t\t\t\tsetProperty(dom, i, checked, oldProps[i], namespace);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn dom;\n}\n\n/**\n * Invoke or update a ref, depending on whether it is a function or object ref.\n * @param {Ref<any> & { _unmount?: unknown }} ref\n * @param {any} value\n * @param {VNode} vnode\n */\nexport function applyRef(ref, value, vnode) {\n\ttry {\n\t\tif (typeof ref == 'function') {\n\t\t\tlet hasRefUnmount = typeof ref._unmount == 'function';\n\t\t\tif (hasRefUnmount) {\n\t\t\t\t// @ts-ignore TS doesn't like moving narrowing checks into variables\n\t\t\t\tref._unmount();\n\t\t\t}\n\n\t\t\tif (!hasRefUnmount || value != NULL) {\n\t\t\t\t// Store the cleanup function on the function\n\t\t\t\t// instance object itself to avoid shape\n\t\t\t\t// transitioning vnode\n\t\t\t\tref._unmount = ref(value);\n\t\t\t}\n\t\t} else ref.current = value;\n\t} catch (e) {\n\t\toptions._catchError(e, vnode);\n\t}\n}\n\n/**\n * Unmount a virtual node from the tree and apply DOM changes\n * @param {VNode} vnode The virtual node to unmount\n * @param {VNode} parentVNode The parent of the VNode that initiated the unmount\n * @param {boolean} [skipRemove] Flag that indicates that a parent node of the\n * current element is already detached from the DOM.\n */\nexport function unmount(vnode, parentVNode, skipRemove) {\n\tlet r;\n\tif (options.unmount) options.unmount(vnode);\n\n\tif ((r = vnode.ref)) {\n\t\tif (!r.current || r.current == vnode._dom) {\n\t\t\tapplyRef(r, NULL, parentVNode);\n\t\t}\n\t}\n\n\tif ((r = vnode._component) != NULL) {\n\t\tif (r.componentWillUnmount) {\n\t\t\ttry {\n\t\t\t\tr.componentWillUnmount();\n\t\t\t} catch (e) {\n\t\t\t\toptions._catchError(e, parentVNode);\n\t\t\t}\n\t\t}\n\n\t\tr.base = r._parentDom = NULL;\n\t}\n\n\tif ((r = vnode._children)) {\n\t\tfor (let i = 0; i < r.length; i++) {\n\t\t\tif (r[i]) {\n\t\t\t\tunmount(\n\t\t\t\t\tr[i],\n\t\t\t\t\tparentVNode,\n\t\t\t\t\tskipRemove || typeof vnode.type != 'function'\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\tif (!skipRemove) {\n\t\tremoveNode(vnode._dom);\n\t}\n\n\tvnode._component = vnode._parent = vnode._dom = UNDEFINED;\n}\n\n/** The `.render()` method for a PFC backing instance. */\nfunction doRender(props, state, context) {\n\treturn this.constructor(props, context);\n}\n","import { EMPTY_OBJ, NULL } from './constants';\nimport { commitRoot, diff } from './diff/index';\nimport { createElement, Fragment } from './create-element';\nimport options from './options';\nimport { slice } from './util';\n\n/**\n * Render a Preact virtual node into a DOM element\n * @param {import('./internal').ComponentChild} vnode The virtual node to render\n * @param {import('./internal').PreactElement} parentDom The DOM element to render into\n * @param {import('./internal').PreactElement | object} [replaceNode] Optional: Attempt to re-use an\n * existing DOM tree rooted at `replaceNode`\n */\nexport function render(vnode, parentDom, replaceNode) {\n\t// https://github.com/preactjs/preact/issues/3794\n\tif (parentDom == document) {\n\t\tparentDom = document.documentElement;\n\t}\n\n\tif (options._root) options._root(vnode, parentDom);\n\n\t// We abuse the `replaceNode` parameter in `hydrate()` to signal if we are in\n\t// hydration mode or not by passing the `hydrate` function instead of a DOM\n\t// element..\n\tlet isHydrating = typeof replaceNode == 'function';\n\n\t// To be able to support calling `render()` multiple times on the same\n\t// DOM node, we need to obtain a reference to the previous tree. We do\n\t// this by assigning a new `_children` property to DOM nodes which points\n\t// to the last rendered tree. By default this property is not present, which\n\t// means that we are mounting a new tree for the first time.\n\tlet oldVNode = isHydrating\n\t\t? NULL\n\t\t: (replaceNode && replaceNode._children) || parentDom._children;\n\n\tvnode = ((!isHydrating && replaceNode) || parentDom)._children =\n\t\tcreateElement(Fragment, NULL, [vnode]);\n\n\t// List of effects that need to be called after diffing.\n\tlet commitQueue = [],\n\t\trefQueue = [];\n\tdiff(\n\t\tparentDom,\n\t\t// Determine the new vnode tree and store it on the DOM element on\n\t\t// our custom `_children` property.\n\t\tvnode,\n\t\toldVNode || EMPTY_OBJ,\n\t\tEMPTY_OBJ,\n\t\tparentDom.namespaceURI,\n\t\t!isHydrating && replaceNode\n\t\t\t? [replaceNode]\n\t\t\t: oldVNode\n\t\t\t\t? NULL\n\t\t\t\t: parentDom.firstChild\n\t\t\t\t\t? slice.call(parentDom.childNodes)\n\t\t\t\t\t: NULL,\n\t\tcommitQueue,\n\t\t!isHydrating && replaceNode\n\t\t\t? replaceNode\n\t\t\t: oldVNode\n\t\t\t\t? oldVNode._dom\n\t\t\t\t: parentDom.firstChild,\n\t\tisHydrating,\n\t\trefQueue\n\t);\n\n\t// Flush all queued effects\n\tcommitRoot(commitQueue, vnode, refQueue);\n}\n\n/**\n * Update an existing DOM element with data from a Preact virtual node\n * @param {import('./internal').ComponentChild} vnode The virtual node to render\n * @param {import('./internal').PreactElement} parentDom The DOM element to update\n */\nexport function hydrate(vnode, parentDom) {\n\trender(vnode, parentDom, hydrate);\n}\n","import { NULL } from '../constants';\n\n/**\n * Find the closest error boundary to a thrown error and call it\n * @param {object} error The thrown value\n * @param {import('../internal').VNode} vnode The vnode that threw the error that was caught (except\n * for unmounting when this parameter is the highest parent that was being\n * unmounted)\n * @param {import('../internal').VNode} [oldVNode]\n * @param {import('../internal').ErrorInfo} [errorInfo]\n */\nexport function _catchError(error, vnode, oldVNode, errorInfo) {\n\t/** @type {import('../internal').Component} */\n\tlet component,\n\t\t/** @type {import('../internal').ComponentType} */\n\t\tctor,\n\t\t/** @type {boolean} */\n\t\thandled;\n\n\tfor (; (vnode = vnode._parent); ) {\n\t\tif ((component = vnode._component) && !component._processingException) {\n\t\t\ttry {\n\t\t\t\tctor = component.constructor;\n\n\t\t\t\tif (ctor && ctor.getDerivedStateFromError != NULL) {\n\t\t\t\t\tcomponent.setState(ctor.getDerivedStateFromError(error));\n\t\t\t\t\thandled = component._dirty;\n\t\t\t\t}\n\n\t\t\t\tif (component.componentDidCatch != NULL) {\n\t\t\t\t\tcomponent.componentDidCatch(error, errorInfo || {});\n\t\t\t\t\thandled = component._dirty;\n\t\t\t\t}\n\n\t\t\t\t// This is an error boundary. Mark it as having bailed out, and whether it was mid-hydration.\n\t\t\t\tif (handled) {\n\t\t\t\t\treturn (component._pendingError = component);\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\terror = e;\n\t\t\t}\n\t\t}\n\t}\n\n\tthrow error;\n}\n","import { options as _options } from 'preact';\n\n/** @type {number} */\nlet currentIndex;\n\n/** @type {import('./internal').Component} */\nlet currentComponent;\n\n/** @type {import('./internal').Component} */\nlet previousComponent;\n\n/** @type {number} */\nlet currentHook = 0;\n\n/** @type {Array<import('./internal').Component>} */\nlet afterPaintEffects = [];\n\n// Cast to use internal Options type\nconst options = /** @type {import('./internal').Options} */ (_options);\n\nlet oldBeforeDiff = options._diff;\nlet oldBeforeRender = options._render;\nlet oldAfterDiff = options.diffed;\nlet oldCommit = options._commit;\nlet oldBeforeUnmount = options.unmount;\nlet oldRoot = options._root;\n\n// We take the minimum timeout for requestAnimationFrame to ensure that\n// the callback is invoked after the next frame. 35ms is based on a 30hz\n// refresh rate, which is the minimum rate for a smooth user experience.\nconst RAF_TIMEOUT = 35;\nlet prevRaf;\n\n/** @type {(vnode: import('./internal').VNode) => void} */\noptions._diff = vnode => {\n\tcurrentComponent = null;\n\tif (oldBeforeDiff) oldBeforeDiff(vnode);\n};\n\noptions._root = (vnode, parentDom) => {\n\tif (vnode && parentDom._children && parentDom._children._mask) {\n\t\tvnode._mask = parentDom._children._mask;\n\t}\n\n\tif (oldRoot) oldRoot(vnode, parentDom);\n};\n\n/** @type {(vnode: import('./internal').VNode) => void} */\noptions._render = vnode => {\n\tif (oldBeforeRender) oldBeforeRender(vnode);\n\n\tcurrentComponent = vnode._component;\n\tcurrentIndex = 0;\n\n\tconst hooks = currentComponent.__hooks;\n\tif (hooks) {\n\t\tif (previousComponent === currentComponent) {\n\t\t\thooks._pendingEffects = [];\n\t\t\tcurrentComponent._renderCallbacks = [];\n\t\t\thooks._list.forEach(hookItem => {\n\t\t\t\tif (hookItem._nextValue) {\n\t\t\t\t\thookItem._value = hookItem._nextValue;\n\t\t\t\t}\n\t\t\t\thookItem._pendingArgs = hookItem._nextValue = undefined;\n\t\t\t});\n\t\t} else {\n\t\t\thooks._pendingEffects.forEach(invokeCleanup);\n\t\t\thooks._pendingEffects.forEach(invokeEffect);\n\t\t\thooks._pendingEffects = [];\n\t\t\tcurrentIndex = 0;\n\t\t}\n\t}\n\tpreviousComponent = currentComponent;\n};\n\n/** @type {(vnode: import('./internal').VNode) => void} */\noptions.diffed = vnode => {\n\tif (oldAfterDiff) oldAfterDiff(vnode);\n\n\tconst c = vnode._component;\n\tif (c && c.__hooks) {\n\t\tif (c.__hooks._pendingEffects.length) afterPaint(afterPaintEffects.push(c));\n\t\tc.__hooks._list.forEach(hookItem => {\n\t\t\tif (hookItem._pendingArgs) {\n\t\t\t\thookItem._args = hookItem._pendingArgs;\n\t\t\t}\n\t\t\thookItem._pendingArgs = undefined;\n\t\t});\n\t}\n\tpreviousComponent = currentComponent = null;\n};\n\n// TODO: Improve typing of commitQueue parameter\n/** @type {(vnode: import('./internal').VNode, commitQueue: any) => void} */\noptions._commit = (vnode, commitQueue) => {\n\tcommitQueue.some(component => {\n\t\ttry {\n\t\t\tcomponent._renderCallbacks.forEach(invokeCleanup);\n\t\t\tcomponent._renderCallbacks = component._renderCallbacks.filter(cb =>\n\t\t\t\tcb._value ? invokeEffect(cb) : true\n\t\t\t);\n\t\t} catch (e) {\n\t\t\tcommitQueue.some(c => {\n\t\t\t\tif (c._renderCallbacks) c._renderCallbacks = [];\n\t\t\t});\n\t\t\tcommitQueue = [];\n\t\t\toptions._catchError(e, component._vnode);\n\t\t}\n\t});\n\n\tif (oldCommit) oldCommit(vnode, commitQueue);\n};\n\n/** @type {(vnode: import('./internal').VNode) => void} */\noptions.unmount = vnode => {\n\tif (oldBeforeUnmount) oldBeforeUnmount(vnode);\n\n\tconst c = vnode._component;\n\tif (c && c.__hooks) {\n\t\tlet hasErrored;\n\t\tc.__hooks._list.forEach(s => {\n\t\t\ttry {\n\t\t\t\tinvokeCleanup(s);\n\t\t\t} catch (e) {\n\t\t\t\thasErrored = e;\n\t\t\t}\n\t\t});\n\t\tc.__hooks = undefined;\n\t\tif (hasErrored) options._catchError(hasErrored, c._vnode);\n\t}\n};\n\n/**\n * Get a hook's state from the currentComponent\n * @param {number} index The index of the hook to get\n * @param {number} type The index of the hook to get\n * @returns {any}\n */\nfunction getHookState(index, type) {\n\tif (options._hook) {\n\t\toptions._hook(currentComponent, index, currentHook || type);\n\t}\n\tcurrentHook = 0;\n\n\t// Largely inspired by:\n\t// * https://github.com/michael-klein/funcy.js/blob/f6be73468e6ec46b0ff5aa3cc4c9baf72a29025a/src/hooks/core_hooks.mjs\n\t// * https://github.com/michael-klein/funcy.js/blob/650beaa58c43c33a74820a3c98b3c7079cf2e333/src/renderer.mjs\n\t// Other implementations to look at:\n\t// * https://codesandbox.io/s/mnox05qp8\n\tconst hooks =\n\t\tcurrentComponent.__hooks ||\n\t\t(currentComponent.__hooks = {\n\t\t\t_list: [],\n\t\t\t_pendingEffects: []\n\t\t});\n\n\tif (index >= hooks._list.length) {\n\t\thooks._list.push({});\n\t}\n\n\treturn hooks._list[index];\n}\n\n/**\n * @template {unknown} S\n * @param {import('./index').Dispatch<import('./index').StateUpdater<S>>} [initialState]\n * @returns {[S, (state: S) => void]}\n */\nexport function useState(initialState) {\n\tcurrentHook = 1;\n\treturn useReducer(invokeOrReturn, initialState);\n}\n\n/**\n * @template {unknown} S\n * @template {unknown} A\n * @param {import('./index').Reducer<S, A>} reducer\n * @param {import('./index').Dispatch<import('./index').StateUpdater<S>>} initialState\n * @param {(initialState: any) => void} [init]\n * @returns {[ S, (state: S) => void ]}\n */\nexport function useReducer(reducer, initialState, init) {\n\t/** @type {import('./internal').ReducerHookState} */\n\tconst hookState = getHookState(currentIndex++, 2);\n\thookState._reducer = reducer;\n\tif (!hookState._component) {\n\t\thookState._value = [\n\t\t\t!init ? invokeOrReturn(undefined, initialState) : init(initialState),\n\n\t\t\taction => {\n\t\t\t\tconst currentValue = hookState._nextValue\n\t\t\t\t\t? hookState._nextValue[0]\n\t\t\t\t\t: hookState._value[0];\n\t\t\t\tconst nextValue = hookState._reducer(currentValue, action);\n\n\t\t\t\tif (currentValue !== nextValue) {\n\t\t\t\t\thookState._nextValue = [nextValue, hookState._value[1]];\n\t\t\t\t\thookState._component.setState({});\n\t\t\t\t}\n\t\t\t}\n\t\t];\n\n\t\thookState._component = currentComponent;\n\n\t\tif (!currentComponent._hasScuFromHooks) {\n\t\t\tcurrentComponent._hasScuFromHooks = true;\n\t\t\tlet prevScu = currentComponent.shouldComponentUpdate;\n\t\t\tconst prevCWU = currentComponent.componentWillUpdate;\n\n\t\t\t// If we're dealing with a forced update `shouldComponentUpdate` will\n\t\t\t// not be called. But we use that to update the hook values, so we\n\t\t\t// need to call it.\n\t\t\tcurrentComponent.componentWillUpdate = function (p, s, c) {\n\t\t\t\tif (this._force) {\n\t\t\t\t\tlet tmp = prevScu;\n\t\t\t\t\t// Clear to avoid other sCU hooks from being called\n\t\t\t\t\tprevScu = undefined;\n\t\t\t\t\tupdateHookState(p, s, c);\n\t\t\t\t\tprevScu = tmp;\n\t\t\t\t}\n\n\t\t\t\tif (prevCWU) prevCWU.call(this, p, s, c);\n\t\t\t};\n\n\t\t\t// This SCU has the purpose of bailing out after repeated updates\n\t\t\t// to stateful hooks.\n\t\t\t// we store the next value in _nextValue[0] and keep doing that for all\n\t\t\t// state setters, if we have next states and\n\t\t\t// all next states within a component end up being equal to their original state\n\t\t\t// we are safe to bail out for this specific component.\n\t\t\t/**\n\t\t\t *\n\t\t\t * @type {import('./internal').Component[\"shouldComponentUpdate\"]}\n\t\t\t */\n\t\t\t// @ts-ignore - We don't use TS to downtranspile\n\t\t\t// eslint-disable-next-line no-inner-declarations\n\t\t\tfunction updateHookState(p, s, c) {\n\t\t\t\tif (!hookState._component.__hooks) return true;\n\n\t\t\t\t/** @type {(x: import('./internal').HookState) => x is import('./internal').ReducerHookState} */\n\t\t\t\tconst isStateHook = x => !!x._component;\n\t\t\t\tconst stateHooks =\n\t\t\t\t\thookState._component.__hooks._list.filter(isStateHook);\n\n\t\t\t\tconst allHooksEmpty = stateHooks.every(x => !x._nextValue);\n\t\t\t\t// When we have no updated hooks in the component we invoke the previous SCU or\n\t\t\t\t// traverse the VDOM tree further.\n\t\t\t\tif (allHooksEmpty) {\n\t\t\t\t\treturn prevScu ? prevScu.call(this, p, s, c) : true;\n\t\t\t\t}\n\n\t\t\t\t// We check whether we have components with a nextValue set that\n\t\t\t\t// have values that aren't equal to one another this pushes\n\t\t\t\t// us to update further down the tree\n\t\t\t\tlet shouldUpdate = hookState._component.props !== p;\n\t\t\t\tstateHooks.forEach(hookItem => {\n\t\t\t\t\tif (hookItem._nextValue) {\n\t\t\t\t\t\tconst currentValue = hookItem._value[0];\n\t\t\t\t\t\thookItem._value = hookItem._nextValue;\n\t\t\t\t\t\thookItem._nextValue = undefined;\n\t\t\t\t\t\tif (currentValue !== hookItem._value[0]) shouldUpdate = true;\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\treturn prevScu\n\t\t\t\t\t? prevScu.call(this, p, s, c) || shouldUpdate\n\t\t\t\t\t: shouldUpdate;\n\t\t\t}\n\n\t\t\tcurrentComponent.shouldComponentUpdate = updateHookState;\n\t\t}\n\t}\n\n\treturn hookState._nextValue || hookState._value;\n}\n\n/**\n * @param {import('./internal').Effect} callback\n * @param {unknown[]} args\n * @returns {void}\n */\nexport function useEffect(callback, args) {\n\t/** @type {import('./internal').EffectHookState} */\n\tconst state = getHookState(currentIndex++, 3);\n\tif (!options._skipEffects && argsChanged(state._args, args)) {\n\t\tstate._value = callback;\n\t\tstate._pendingArgs = args;\n\n\t\tcurrentComponent.__hooks._pendingEffects.push(state);\n\t}\n}\n\n/**\n * @param {import('./internal').Effect} callback\n * @param {unknown[]} args\n * @returns {void}\n */\nexport function useLayoutEffect(callback, args) {\n\t/** @type {import('./internal').EffectHookState} */\n\tconst state = getHookState(currentIndex++, 4);\n\tif (!options._skipEffects && argsChanged(state._args, args)) {\n\t\tstate._value = callback;\n\t\tstate._pendingArgs = args;\n\n\t\tcurrentComponent._renderCallbacks.push(state);\n\t}\n}\n\n/** @type {(initialValue: unknown) => unknown} */\nexport function useRef(initialValue) {\n\tcurrentHook = 5;\n\treturn useMemo(() => ({ current: initialValue }), []);\n}\n\n/**\n * @param {object} ref\n * @param {() => object} createHandle\n * @param {unknown[]} args\n * @returns {void}\n */\nexport function useImperativeHandle(ref, createHandle, args) {\n\tcurrentHook = 6;\n\tuseLayoutEffect(\n\t\t() => {\n\t\t\tif (typeof ref == 'function') {\n\t\t\t\tconst result = ref(createHandle());\n\t\t\t\treturn () => {\n\t\t\t\t\tref(null);\n\t\t\t\t\tif (result && typeof result == 'function') result();\n\t\t\t\t};\n\t\t\t} else if (ref) {\n\t\t\t\tref.current = createHandle();\n\t\t\t\treturn () => (ref.current = null);\n\t\t\t}\n\t\t},\n\t\targs == null ? args : args.concat(ref)\n\t);\n}\n\n/**\n * @template {unknown} T\n * @param {() => T} factory\n * @param {unknown[]} args\n * @returns {T}\n */\nexport function useMemo(factory, args) {\n\t/** @type {import('./internal').MemoHookState<T>} */\n\tconst state = getHookState(currentIndex++, 7);\n\tif (argsChanged(state._args, args)) {\n\t\tstate._value = factory();\n\t\tstate._args = args;\n\t\tstate._factory = factory;\n\t}\n\n\treturn state._value;\n}\n\n/**\n * @param {() => void} callback\n * @param {unknown[]} args\n * @returns {() => void}\n */\nexport function useCallback(callback, args) {\n\tcurrentHook = 8;\n\treturn useMemo(() => callback, args);\n}\n\n/**\n * @param {import('./internal').PreactContext} context\n */\nexport function useContext(context) {\n\tconst provider = currentComponent.context[context._id];\n\t// We could skip this call here, but than we'd not call\n\t// `options._hook`. We need to do that in order to make\n\t// the devtools aware of this hook.\n\t/** @type {import('./internal').ContextHookState} */\n\tconst state = getHookState(currentIndex++, 9);\n\t// The devtools needs access to the context object to\n\t// be able to pull of the default value when no provider\n\t// is present in the tree.\n\tstate._context = context;\n\tif (!provider) return context._defaultValue;\n\t// This is probably not safe to convert to \"!\"\n\tif (state._value == null) {\n\t\tstate._value = true;\n\t\tprovider.sub(currentComponent);\n\t}\n\treturn provider.props.value;\n}\n\n/**\n * Display a custom label for a custom hook for the devtools panel\n * @type {<T>(value: T, cb?: (value: T) => string | number) => void}\n */\nexport function useDebugValue(value, formatter) {\n\tif (options.useDebugValue) {\n\t\toptions.useDebugValue(\n\t\t\tformatter ? formatter(value) : /** @type {any}*/ (value)\n\t\t);\n\t}\n}\n\n/**\n * @param {(error: unknown, errorInfo: import('preact').ErrorInfo) => void} cb\n * @returns {[unknown, () => void]}\n */\nexport function useErrorBoundary(cb) {\n\t/** @type {import('./internal').ErrorBoundaryHookState} */\n\tconst state = getHookState(currentIndex++, 10);\n\tconst errState = useState();\n\tstate._value = cb;\n\tif (!currentComponent.componentDidCatch) {\n\t\tcurrentComponent.componentDidCatch = (err, errorInfo) => {\n\t\t\tif (state._value) state._value(err, errorInfo);\n\t\t\terrState[1](err);\n\t\t};\n\t}\n\treturn [\n\t\terrState[0],\n\t\t() => {\n\t\t\terrState[1](undefined);\n\t\t}\n\t];\n}\n\n/** @type {() => string} */\nexport function useId() {\n\t/** @type {import('./internal').IdHookState} */\n\tconst state = getHookState(currentIndex++, 11);\n\tif (!state._value) {\n\t\t// Grab either the root node or the nearest async boundary node.\n\t\t/** @type {import('./internal').VNode} */\n\t\tlet root = currentComponent._vnode;\n\t\twhile (root !== null && !root._mask && root._parent !== null) {\n\t\t\troot = root._parent;\n\t\t}\n\n\t\tlet mask = root._mask || (root._mask = [0, 0]);\n\t\tstate._value = 'P' + mask[0] + '-' + mask[1]++;\n\t}\n\n\treturn state._value;\n}\n\n/**\n * After paint effects consumer.\n */\nfunction flushAfterPaintEffects() {\n\tlet component;\n\twhile ((component = afterPaintEffects.shift())) {\n\t\tif (!component._parentDom || !component.__hooks) continue;\n\t\ttry {\n\t\t\tcomponent.__hooks._pendingEffects.forEach(invokeCleanup);\n\t\t\tcomponent.__hooks._pendingEffects.forEach(invokeEffect);\n\t\t\tcomponent.__hooks._pendingEffects = [];\n\t\t} catch (e) {\n\t\t\tcomponent.__hooks._pendingEffects = [];\n\t\t\toptions._catchError(e, component._vnode);\n\t\t}\n\t}\n}\n\nlet HAS_RAF = typeof requestAnimationFrame == 'function';\n\n/**\n * Schedule a callback to be invoked after the browser has a chance to paint a new frame.\n * Do this by combining requestAnimationFrame (rAF) + setTimeout to invoke a callback after\n * the next browser frame.\n *\n * Also, schedule a timeout in parallel to the the rAF to ensure the callback is invoked\n * even if RAF doesn't fire (for example if the browser tab is not visible)\n *\n * @param {() => void} callback\n */\nfunction afterNextFrame(callback) {\n\tconst done = () => {\n\t\tclearTimeout(timeout);\n\t\tif (HAS_RAF) cancelAnimationFrame(raf);\n\t\tsetTimeout(callback);\n\t};\n\tconst timeout = setTimeout(done, RAF_TIMEOUT);\n\n\tlet raf;\n\tif (HAS_RAF) {\n\t\traf = requestAnimationFrame(done);\n\t}\n}\n\n// Note: if someone used options.debounceRendering = requestAnimationFrame,\n// then effects will ALWAYS run on the NEXT frame instead of the current one, incurring a ~16ms delay.\n// Perhaps this is not such a big deal.\n/**\n * Schedule afterPaintEffects flush after the browser paints\n * @param {number} newQueueLength\n * @returns {void}\n */\nfunction afterPaint(newQueueLength) {\n\tif (newQueueLength === 1 || prevRaf !== options.requestAnimationFrame) {\n\t\tprevRaf = options.requestAnimationFrame;\n\t\t(prevRaf || afterNextFrame)(flushAfterPaintEffects);\n\t}\n}\n\n/**\n * @param {import('./internal').HookState} hook\n * @returns {void}\n */\nfunction invokeCleanup(hook) {\n\t// A hook cleanup can introduce a call to render which creates a new root, this will call options.vnode\n\t// and move the currentComponent away.\n\tconst comp = currentComponent;\n\tlet cleanup = hook._cleanup;\n\tif (typeof cleanup == 'function') {\n\t\thook._cleanup = undefined;\n\t\tcleanup();\n\t}\n\n\tcurrentComponent = comp;\n}\n\n/**\n * Invoke a Hook's effect\n * @param {import('./internal').EffectHookState} hook\n * @returns {void}\n */\nfunction invokeEffect(hook) {\n\t// A hook call can introduce a call to render which creates a new root, this will call options.vnode\n\t// and move the currentComponent away.\n\tconst comp = currentComponent;\n\thook._cleanup = hook._value();\n\tcurrentComponent = comp;\n}\n\n/**\n * @param {unknown[]} oldArgs\n * @param {unknown[]} newArgs\n * @returns {boolean}\n */\nfunction argsChanged(oldArgs, newArgs) {\n\treturn (\n\t\t!oldArgs ||\n\t\toldArgs.length !== newArgs.length ||\n\t\tnewArgs.some((arg, index) => arg !== oldArgs[index])\n\t);\n}\n\n/**\n * @template Arg\n * @param {Arg} arg\n * @param {(arg: Arg) => any} f\n * @returns {any}\n */\nfunction invokeOrReturn(arg, f) {\n\treturn typeof f == 'function' ? f(arg) : f;\n}\n","/**\n * Assign properties from `props` to `obj`\n * @template O, P The obj and props types\n * @param {O} obj The object to copy properties to\n * @param {P} props The object to copy properties from\n * @returns {O & P}\n */\nexport function assign(obj, props) {\n\tfor (let i in props) obj[i] = props[i];\n\treturn /** @type {O & P} */ (obj);\n}\n\n/**\n * Check if two objects have a different shape\n * @param {object} a\n * @param {object} b\n * @returns {boolean}\n */\nexport function shallowDiffers(a, b) {\n\tfor (let i in a) if (i !== '__source' && !(i in b)) return true;\n\tfor (let i in b) if (i !== '__source' && a[i] !== b[i]) return true;\n\treturn false;\n}\n\n/**\n * Check if two values are the same value\n * @param {*} x\n * @param {*} y\n * @returns {boolean}\n */\nexport function is(x, y) {\n\treturn (x === y && (x !== 0 || 1 / x === 1 / y)) || (x !== x && y !== y);\n}\n","import { useState, useLayoutEffect, useEffect } from 'preact/hooks';\nimport { is } from './util';\n\n/**\n * This is taken from https://github.com/facebook/react/blob/main/packages/use-sync-external-store/src/useSyncExternalStoreShimClient.js#L84\n * on a high level this cuts out the warnings, ... and attempts a smaller implementation\n * @typedef {{ _value: any; _getSnapshot: () => any }} Store\n */\nexport function useSyncExternalStore(subscribe, getSnapshot) {\n\tconst value = getSnapshot();\n\n\t/**\n\t * @typedef {{ _instance: Store }} StoreRef\n\t * @type {[StoreRef, (store: StoreRef) => void]}\n\t */\n\tconst [{ _instance }, forceUpdate] = useState({\n\t\t_instance: { _value: value, _getSnapshot: getSnapshot }\n\t});\n\n\tuseLayoutEffect(() => {\n\t\t_instance._value = value;\n\t\t_instance._getSnapshot = getSnapshot;\n\n\t\tif (didSnapshotChange(_instance)) {\n\t\t\tforceUpdate({ _instance });\n\t\t}\n\t}, [subscribe, value, getSnapshot]);\n\n\tuseEffect(() => {\n\t\tif (didSnapshotChange(_instance)) {\n\t\t\tforceUpdate({ _instance });\n\t\t}\n\n\t\treturn subscribe(() => {\n\t\t\tif (didSnapshotChange(_instance)) {\n\t\t\t\tforceUpdate({ _instance });\n\t\t\t}\n\t\t});\n\t}, [subscribe]);\n\n\treturn value;\n}\n\n/** @type {(inst: Store) => boolean} */\nfunction didSnapshotChange(inst) {\n\tconst latestGetSnapshot = inst._getSnapshot;\n\tconst prevValue = inst._value;\n\ttry {\n\t\tconst nextValue = latestGetSnapshot();\n\t\treturn !is(prevValue, nextValue);\n\t} catch (error) {\n\t\treturn true;\n\t}\n}\n\nexport function startTransition(cb) {\n\tcb();\n}\n\nexport function useDeferredValue(val) {\n\treturn val;\n}\n\nexport function useTransition() {\n\treturn [false, startTransition];\n}\n\n// TODO: in theory this should be done after a VNode is diffed as we want to insert\n// styles/... before it attaches\nexport const useInsertionEffect = useLayoutEffect;\n","import { Component } from 'preact';\nimport { shallowDiffers } from './util';\n\n/**\n * Component class with a predefined `shouldComponentUpdate` implementation\n */\nexport function PureComponent(p, c) {\n\tthis.props = p;\n\tthis.context = c;\n}\nPureComponent.prototype = new Component();\n// Some third-party libraries check if this property is present\nPureComponent.prototype.isPureReactComponent = true;\nPureComponent.prototype.shouldComponentUpdate = function (props, state) {\n\treturn shallowDiffers(this.props, props) || shallowDiffers(this.state, state);\n};\n","import { createElement } from 'preact';\nimport { shallowDiffers } from './util';\n\n/**\n * Memoize a component, so that it only updates when the props actually have\n * changed. This was previously known as `React.pure`.\n * @param {import('./internal').FunctionComponent} c functional component\n * @param {(prev: object, next: object) => boolean} [comparer] Custom equality function\n * @returns {import('./internal').FunctionComponent}\n */\nexport function memo(c, comparer) {\n\tfunction shouldUpdate(nextProps) {\n\t\tlet ref = this.props.ref;\n\t\tlet updateRef = ref == nextProps.ref;\n\t\tif (!updateRef && ref) {\n\t\t\tref.call ? ref(null) : (ref.current = null);\n\t\t}\n\n\t\tif (!comparer) {\n\t\t\treturn shallowDiffers(this.props, nextProps);\n\t\t}\n\n\t\treturn !comparer(this.props, nextProps) || !updateRef;\n\t}\n\n\tfunction Memoed(props) {\n\t\tthis.shouldComponentUpdate = shouldUpdate;\n\t\treturn createElement(c, props);\n\t}\n\tMemoed.displayName = 'Memo(' + (c.displayName || c.name) + ')';\n\tMemoed.prototype.isReactComponent = true;\n\tMemoed._forwarded = true;\n\tMemoed.type = c;\n\treturn Memoed;\n}\n","import { options } from 'preact';\nimport { assign } from './util';\n\nlet oldDiffHook = options._diff;\noptions._diff = vnode => {\n\tif (vnode.type && vnode.type._forwarded && vnode.ref) {\n\t\tvnode.props.ref = vnode.ref;\n\t\tvnode.ref = null;\n\t}\n\tif (oldDiffHook) oldDiffHook(vnode);\n};\n\nexport const REACT_FORWARD_SYMBOL =\n\t(typeof Symbol != 'undefined' &&\n\t\tSymbol.for &&\n\t\tSymbol.for('react.forward_ref')) ||\n\t0xf47;\n\n/**\n * Pass ref down to a child. This is mainly used in libraries with HOCs that\n * wrap components. Using `forwardRef` there is an easy way to get a reference\n * of the wrapped component instead of one of the wrapper itself.\n * @param {import('./index').ForwardFn} fn\n * @returns {import('./internal').FunctionComponent}\n */\nexport function forwardRef(fn) {\n\tfunction Forwarded(props) {\n\t\tlet clone = assign({}, props);\n\t\tdelete clone.ref;\n\t\treturn fn(clone, props.ref || null);\n\t}\n\n\t// mobx-react checks for this being present\n\tForwarded.$$typeof = REACT_FORWARD_SYMBOL;\n\t// mobx-react heavily relies on implementation details.\n\t// It expects an object here with a `render` property,\n\t// and prototype.render will fail. Without this\n\t// mobx-react throws.\n\tForwarded.render = fn;\n\n\tForwarded.prototype.isReactComponent = Forwarded._forwarded = true;\n\tForwarded.displayName = 'ForwardRef(' + (fn.displayName || fn.name) + ')';\n\treturn Forwarded;\n}\n","import { toChildArray } from 'preact';\n\nconst mapFn = (children, fn) => {\n\tif (children == null) return null;\n\treturn toChildArray(toChildArray(children).map(fn));\n};\n\n// This API is completely unnecessary for Preact, so it's basically passthrough.\nexport const Children = {\n\tmap: mapFn,\n\tforEach: mapFn,\n\tcount(children) {\n\t\treturn children ? toChildArray(children).length : 0;\n\t},\n\tonly(children) {\n\t\tconst normalized = toChildArray(children);\n\t\tif (normalized.length !== 1) throw 'Children.only';\n\t\treturn normalized[0];\n\t},\n\ttoArray: toChildArray\n};\n","import { Component, createElement, options, Fragment } from 'preact';\nimport { MODE_HYDRATE } from '../../src/constants';\nimport { assign } from './util';\n\nconst oldCatchError = options._catchError;\noptions._catchError = function (error, newVNode, oldVNode, errorInfo) {\n\tif (error.then) {\n\t\t/** @type {import('./internal').Component} */\n\t\tlet component;\n\t\tlet vnode = newVNode;\n\n\t\tfor (; (vnode = vnode._parent); ) {\n\t\t\tif ((component = vnode._component) && component._childDidSuspend) {\n\t\t\t\tif (newVNode._dom == null) {\n\t\t\t\t\tnewVNode._dom = oldVNode._dom;\n\t\t\t\t\tnewVNode._children = oldVNode._children;\n\t\t\t\t}\n\t\t\t\t// Don't call oldCatchError if we found a Suspense\n\t\t\t\treturn component._childDidSuspend(error, newVNode);\n\t\t\t}\n\t\t}\n\t}\n\toldCatchError(error, newVNode, oldVNode, errorInfo);\n};\n\nconst oldUnmount = options.unmount;\noptions.unmount = function (vnode) {\n\t/** @type {import('./internal').Component} */\n\tconst component = vnode._component;\n\tif (component) component._unmounted = true;\n\tif (component && component._onResolve) {\n\t\tcomponent._onResolve();\n\t}\n\n\t// if the component is still hydrating\n\t// most likely it is because the component is suspended\n\t// we set the vnode.type as `null` so that it is not a typeof function\n\t// so the unmount will remove the vnode._dom\n\tif (component && vnode._flags & MODE_HYDRATE) {\n\t\tvnode.type = null;\n\t}\n\n\tif (oldUnmount) oldUnmount(vnode);\n};\n\nfunction detachedClone(vnode, detachedParent, parentDom) {\n\tif (vnode) {\n\t\tif (vnode._component && vnode._component.__hooks) {\n\t\t\tvnode._component.__hooks._list.forEach(effect => {\n\t\t\t\tif (typeof effect._cleanup == 'function') effect._cleanup();\n\t\t\t});\n\n\t\t\tvnode._component.__hooks = null;\n\t\t}\n\n\t\tvnode = assign({}, vnode);\n\t\tif (vnode._component != null) {\n\t\t\tif (vnode._component._parentDom === parentDom) {\n\t\t\t\tvnode._component._parentDom = detachedParent;\n\t\t\t}\n\n\t\t\tvnode._component._force = true;\n\n\t\t\tvnode._component = null;\n\t\t}\n\n\t\tvnode._children =\n\t\t\tvnode._children &&\n\t\t\tvnode._children.map(child =>\n\t\t\t\tdetachedClone(child, detachedParent, parentDom)\n\t\t\t);\n\t}\n\n\treturn vnode;\n}\n\nfunction removeOriginal(vnode, detachedParent, originalParent) {\n\tif (vnode && originalParent) {\n\t\tvnode._original = null;\n\t\tvnode._children =\n\t\t\tvnode._children &&\n\t\t\tvnode._children.map(child =>\n\t\t\t\tremoveOriginal(child, detachedParent, originalParent)\n\t\t\t);\n\n\t\tif (vnode._component) {\n\t\t\tif (vnode._component._parentDom === detachedParent) {\n\t\t\t\tif (vnode._dom) {\n\t\t\t\t\toriginalParent.appendChild(vnode._dom);\n\t\t\t\t}\n\t\t\t\tvnode._component._force = true;\n\t\t\t\tvnode._component._parentDom = originalParent;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn vnode;\n}\n\n// having custom inheritance instead of a class here saves a lot of bytes\nexport function Suspense() {\n\t// we do not call super here to golf some bytes...\n\tthis._pendingSuspensionCount = 0;\n\tthis._suspenders = null;\n\tthis._detachOnNextRender = null;\n}\n\n// Things we do here to save some bytes but are not proper JS inheritance:\n// - call `new Component()` as the prototype\n// - do not set `Suspense.prototype.constructor` to `Suspense`\nSuspense.prototype = new Component();\n\n/**\n * @this {import('./internal').SuspenseComponent}\n * @param {Promise} promise The thrown promise\n * @param {import('./internal').VNode<any, any>} suspendingVNode The suspending component\n */\nSuspense.prototype._childDidSuspend = function (promise, suspendingVNode) {\n\tconst suspendingComponent = suspendingVNode._component;\n\n\t/** @type {import('./internal').SuspenseComponent} */\n\tconst c = this;\n\n\tif (c._suspenders == null) {\n\t\tc._suspenders = [];\n\t}\n\tc._suspenders.push(suspendingComponent);\n\n\tconst resolve = suspended(c._vnode);\n\n\tlet resolved = false;\n\tconst onResolved = () => {\n\t\tif (resolved || c._unmounted) return;\n\n\t\tresolved = true;\n\t\tsuspendingComponent._onResolve = null;\n\n\t\tif (resolve) {\n\t\t\tresolve(onSuspensionComplete);\n\t\t} else {\n\t\t\tonSuspensionComplete();\n\t\t}\n\t};\n\n\tsuspendingComponent._onResolve = onResolved;\n\n\t// Store and null _parentDom to prevent setState/forceUpdate from\n\t// scheduling renders while suspended. Render would be a no-op anyway\n\t// since renderComponent checks _parentDom, but this avoids queue churn.\n\tconst originalParentDom = suspendingComponent._parentDom;\n\tsuspendingComponent._parentDom = null;\n\n\tconst onSuspensionComplete = () => {\n\t\tif (!--c._pendingSuspensionCount) {\n\t\t\t// If the suspension was during hydration we don't need to restore the\n\t\t\t// suspended children into the _children array\n\t\t\tif (c.state._suspended) {\n\t\t\t\tconst suspendedVNode = c.state._suspended;\n\t\t\t\tc._vnode._children[0] = removeOriginal(\n\t\t\t\t\tsuspendedVNode,\n\t\t\t\t\tsuspendedVNode._component._parentDom,\n\t\t\t\t\tsuspendedVNode._component._originalParentDom\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tc.setState({ _suspended: (c._detachOnNextRender = null) });\n\n\t\t\tlet suspended;\n\t\t\twhile ((suspended = c._suspenders.pop())) {\n\t\t\t\t// Restore _parentDom before forceUpdate so render can proceed\n\t\t\t\tsuspended._parentDom = originalParentDom;\n\t\t\t\tsuspended.forceUpdate();\n\t\t\t}\n\t\t}\n\t};\n\n\t/**\n\t * We do not set `suspended: true` during hydration because we want the actual markup\n\t * to remain on screen and hydrate it when the suspense actually gets resolved.\n\t * While in non-hydration cases the usual fallback -> component flow would occour.\n\t */\n\tif (\n\t\t!c._pendingSuspensionCount++ &&\n\t\t!(suspendingVNode._flags & MODE_HYDRATE)\n\t) {\n\t\tc.setState({ _suspended: (c._detachOnNextRender = c._vnode._children[0]) });\n\t}\n\tpromise.then(onResolved, onResolved);\n};\n\nSuspense.prototype.componentWillUnmount = function () {\n\tthis._suspenders = [];\n};\n\n/**\n * @this {import('./internal').SuspenseComponent}\n * @param {import('./internal').SuspenseComponent[\"props\"]} props\n * @param {import('./internal').SuspenseState} state\n */\nSuspense.prototype.render = function (props, state) {\n\tif (this._detachOnNextRender) {\n\t\t// When the Suspense's _vnode was created by a call to createVNode\n\t\t// (i.e. due to a setState further up in the tree)\n\t\t// it's _children prop is null, in this case we \"forget\" about the parked vnodes to detach\n\t\tif (this._vnode._children) {\n\t\t\tconst detachedParent = document.createElement('div');\n\t\t\tconst detachedComponent = this._vnode._children[0]._component;\n\t\t\tthis._vnode._children[0] = detachedClone(\n\t\t\t\tthis._detachOnNextRender,\n\t\t\t\tdetachedParent,\n\t\t\t\t(detachedComponent._originalParentDom = detachedComponent._parentDom)\n\t\t\t);\n\t\t}\n\n\t\tthis._detachOnNextRender = null;\n\t}\n\n\t// Wrap fallback tree in a VNode that prevents itself from being marked as aborting mid-hydration:\n\t/** @type {import('./internal').VNode} */\n\tconst fallback =\n\t\tstate._suspended && createElement(Fragment, null, props.fallback);\n\tif (fallback) fallback._flags &= ~MODE_HYDRATE;\n\n\treturn [\n\t\tcreateElement(Fragment, null, state._suspended ? null : props.children),\n\t\tfallback\n\t];\n};\n\n/**\n * Checks and calls the parent component's _suspended method, passing in the\n * suspended vnode. This is a way for a parent (e.g. SuspenseList) to get notified\n * that one of its children/descendants suspended.\n *\n * The parent MAY return a callback. The callback will get called when the\n * suspension resolves, notifying the parent of the fact.\n * Moreover, the callback gets function `unsuspend` as a parameter. The resolved\n * child descendant will not actually get unsuspended until `unsuspend` gets called.\n * This is a way for the parent to delay unsuspending.\n *\n * If the parent does not return a callback then the resolved vnode\n * gets unsuspended immediately when it resolves.\n *\n * @param {import('./internal').VNode} vnode\n * @returns {((unsuspend: () => void) => void)?}\n */\nexport function suspended(vnode) {\n\tif (!vnode._parent) return null;\n\t/** @type {import('./internal').Component} */\n\tlet component = vnode._parent._component;\n\treturn component && component._suspended && component._suspended(vnode);\n}\n\nexport function lazy(loader) {\n\tlet prom;\n\tlet component = null;\n\tlet error;\n\tlet resolved;\n\n\tfunction Lazy(props) {\n\t\tif (!prom) {\n\t\t\tprom = loader();\n\t\t\tprom.then(\n\t\t\t\texports => {\n\t\t\t\t\tif (exports) {\n\t\t\t\t\t\tcomponent = exports.default || exports;\n\t\t\t\t\t}\n\t\t\t\t\tresolved = true;\n\t\t\t\t},\n\t\t\t\te => {\n\t\t\t\t\terror = e;\n\t\t\t\t\tresolved = true;\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\n\t\tif (error) {\n\t\t\tthrow error;\n\t\t}\n\n\t\tif (!resolved) {\n\t\t\tthrow prom;\n\t\t}\n\n\t\treturn component ? createElement(component, props) : null;\n\t}\n\n\tLazy.displayName = 'Lazy';\n\tLazy._forwarded = true;\n\treturn Lazy;\n}\n","import { Component, toChildArray } from 'preact';\nimport { suspended } from './suspense.js';\n\n// Indexes to linked list nodes (nodes are stored as arrays to save bytes).\nconst SUSPENDED_COUNT = 0;\nconst RESOLVED_COUNT = 1;\nconst NEXT_NODE = 2;\n\n// Having custom inheritance instead of a class here saves a lot of bytes.\nexport function SuspenseList() {\n\tthis._next = null;\n\tthis._map = null;\n}\n\n// Mark one of child's earlier suspensions as resolved.\n// Some pending callbacks may become callable due to this\n// (e.g. the last suspended descendant gets resolved when\n// revealOrder === 'together'). Process those callbacks as well.\nconst resolve = (list, child, node) => {\n\tif (++node[RESOLVED_COUNT] === node[SUSPENDED_COUNT]) {\n\t\t// The number a child (or any of its descendants) has been suspended\n\t\t// matches the number of times it's been resolved. Therefore we\n\t\t// mark the child as completely resolved by deleting it from ._map.\n\t\t// This is used to figure out when *all* children have been completely\n\t\t// resolved when revealOrder is 'together'.\n\t\tlist._map.delete(child);\n\t}\n\n\t// If revealOrder is falsy then we can do an early exit, as the\n\t// callbacks won't get queued in the node anyway.\n\t// If revealOrder is 'together' then also do an early exit\n\t// if all suspended descendants have not yet been resolved.\n\tif (\n\t\t!list.props.revealOrder ||\n\t\t(list.props.revealOrder[0] === 't' && list._map.size)\n\t) {\n\t\treturn;\n\t}\n\n\t// Walk the currently suspended children in order, calling their\n\t// stored callbacks on the way. Stop if we encounter a child that\n\t// has not been completely resolved yet.\n\tnode = list._next;\n\twhile (node) {\n\t\twhile (node.length > 3) {\n\t\t\tnode.pop()();\n\t\t}\n\t\tif (node[RESOLVED_COUNT] < node[SUSPENDED_COUNT]) {\n\t\t\tbreak;\n\t\t}\n\t\tlist._next = node = node[NEXT_NODE];\n\t}\n};\n\n// Things we do here to save some bytes but are not proper JS inheritance:\n// - call `new Component()` as the prototype\n// - do not set `Suspense.prototype.constructor` to `Suspense`\nSuspenseList.prototype = new Component();\n\nSuspenseList.prototype._suspended = function (child) {\n\tconst list = this;\n\tconst delegated = suspended(list._vnode);\n\n\tlet node = list._map.get(child);\n\tnode[SUSPENDED_COUNT]++;\n\n\treturn unsuspend => {\n\t\tconst wrappedUnsuspend = () => {\n\t\t\tif (!list.props.revealOrder) {\n\t\t\t\t// Special case the undefined (falsy) revealOrder, as there\n\t\t\t\t// is no need to coordinate a specific order or unsuspends.\n\t\t\t\tunsuspend();\n\t\t\t} else {\n\t\t\t\tnode.push(unsuspend);\n\t\t\t\tresolve(list, child, node);\n\t\t\t}\n\t\t};\n\t\tif (delegated) {\n\t\t\tdelegated(wrappedUnsuspend);\n\t\t} else {\n\t\t\twrappedUnsuspend();\n\t\t}\n\t};\n};\n\nSuspenseList.prototype.render = function (props) {\n\tthis._next = null;\n\tthis._map = new Map();\n\n\tconst children = toChildArray(props.children);\n\tif (props.revealOrder && props.revealOrder[0] === 'b') {\n\t\t// If order === 'backwards' (or, well, anything starting with a 'b')\n\t\t// then flip the child list around so that the last child will be\n\t\t// the first in the linked list.\n\t\tchildren.reverse();\n\t}\n\t// Build the linked list. Iterate through the children in reverse order\n\t// so that `_next` points to the first linked list node to be resolved.\n\tfor (let i = children.length; i--; ) {\n\t\t// Create a new linked list node as an array of form:\n\t\t// \t[suspended_count, resolved_count, next_node]\n\t\t// where suspended_count and resolved_count are numeric counters for\n\t\t// keeping track how many times a node has been suspended and resolved.\n\t\t//\n\t\t// Note that suspended_count starts from 1 instead of 0, so we can block\n\t\t// processing callbacks until componentDidMount has been called. In a sense\n\t\t// node is suspended at least until componentDidMount gets called!\n\t\t//\n\t\t// Pending callbacks are added to the end of the node:\n\t\t// \t[suspended_count, resolved_count, next_node, callback_0, callback_1, ...]\n\t\tthis._map.set(children[i], (this._next = [1, 0, this._next]));\n\t}\n\treturn props.children;\n};\n\nSuspenseList.prototype.componentDidUpdate =\n\tSuspenseList.prototype.componentDidMount = function () {\n\t\t// Iterate through all children after mounting for two reasons:\n\t\t// 1. As each node[SUSPENDED_COUNT] starts from 1, this iteration increases\n\t\t// each node[RELEASED_COUNT] by 1, therefore balancing the counters.\n\t\t// The nodes can now be completely consumed from the linked list.\n\t\t// 2. Handle nodes that might have gotten resolved between render and\n\t\t// componentDidMount.\n\t\tthis._map.forEach((node, child) => {\n\t\t\tresolve(this, child, node);\n\t\t});\n\t};\n","import { createElement, render } from 'preact';\n\n/**\n * @param {import('../../src/index').RenderableProps<{ context: any }>} props\n */\nfunction ContextProvider(props) {\n\tthis.getChildContext = () => props.context;\n\treturn props.children;\n}\n\n/**\n * Portal component\n * @this {import('./internal').Component}\n * @param {object | null | undefined} props\n *\n * TODO: use createRoot() instead of fake root\n */\nfunction Portal(props) {\n\tconst _this = this;\n\tlet container = props._container;\n\n\t_this.componentWillUnmount = function () {\n\t\trender(null, _this._temp);\n\t\t_this._temp = null;\n\t\t_this._container = null;\n\t};\n\n\t// When we change container we should clear our old container and\n\t// indicate a new mount.\n\tif (_this._container && _this._container !== container) {\n\t\t_this.componentWillUnmount();\n\t}\n\n\tif (!_this._temp) {\n\t\t// Ensure the element has a mask for useId invocations\n\t\tlet root = _this._vnode;\n\t\twhile (root !== null && !root._mask && root._parent !== null) {\n\t\t\troot = root._parent;\n\t\t}\n\n\t\t_this._container = container;\n\n\t\t// Create a fake DOM parent node that manages a subset of `container`'s children:\n\t\t_this._temp = {\n\t\t\tnodeType: 1,\n\t\t\tparentNode: container,\n\t\t\tchildNodes: [],\n\t\t\t_children: { _mask: root._mask },\n\t\t\tcontains: () => true,\n\t\t\tnamespaceURI: container.namespaceURI,\n\t\t\tinsertBefore(child, before) {\n\t\t\t\tthis.childNodes.push(child);\n\t\t\t\t_this._container.insertBefore(child, before);\n\t\t\t},\n\t\t\tremoveChild(child) {\n\t\t\t\tthis.childNodes.splice(this.childNodes.indexOf(child) >>> 1, 1);\n\t\t\t\t_this._container.removeChild(child);\n\t\t\t}\n\t\t};\n\t}\n\n\t// Render our wrapping element into temp.\n\trender(\n\t\tcreateElement(ContextProvider, { context: _this.context }, props._vnode),\n\t\t_this._temp\n\t);\n}\n\n/**\n * Create a `Portal` to continue rendering the vnode tree at a different DOM node\n * @param {import('./internal').VNode} vnode The vnode to render\n * @param {import('./internal').PreactElement} container The DOM node to continue rendering in to.\n */\nexport function createPortal(vnode, container) {\n\tconst el = createElement(Portal, { _vnode: vnode, _container: container });\n\tel.containerInfo = container;\n\treturn el;\n}\n","import {\n\trender as preactRender,\n\thydrate as preactHydrate,\n\toptions,\n\ttoChildArray,\n\tComponent\n} from 'preact';\nimport {\n\tuseCallback,\n\tuseContext,\n\tuseDebugValue,\n\tuseEffect,\n\tuseId,\n\tuseImperativeHandle,\n\tuseLayoutEffect,\n\tuseMemo,\n\tuseReducer,\n\tuseRef,\n\tuseState\n} from 'preact/hooks';\nimport {\n\tuseDeferredValue,\n\tuseInsertionEffect,\n\tuseSyncExternalStore,\n\tuseTransition\n} from './index';\n\nexport const REACT_ELEMENT_TYPE =\n\t(typeof Symbol != 'undefined' && Symbol.for && Symbol.for('react.element')) ||\n\t0xeac7;\n\nconst CAMEL_PROPS =\n\t/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/;\nconst ON_ANI = /^on(Ani|Tra|Tou|BeforeInp|Compo)/;\nconst CAMEL_REPLACE = /[A-Z0-9]/g;\nconst IS_DOM = typeof document !== 'undefined';\n\n// Input types for which onchange should not be converted to oninput.\n// type=\"file|checkbox|radio\", plus \"range\" in IE11.\n// (IE11 doesn't support Symbol, which we use here to turn `rad` into `ra` which matches \"range\")\nconst onChangeInputType = type =>\n\t(typeof Symbol != 'undefined' && typeof Symbol() == 'symbol'\n\t\t? /fil|che|rad/\n\t\t: /fil|che|ra/\n\t).test(type);\n\n// Some libraries like `react-virtualized` explicitly check for this.\nComponent.prototype.isReactComponent = {};\n\n// `UNSAFE_*` lifecycle hooks\n// Preact only ever invokes the unprefixed methods.\n// Here we provide a base \"fallback\" implementation that calls any defined UNSAFE_ prefixed method.\n// - If a component defines its own `componentDidMount()` (including via defineProperty), use that.\n// - If a component defines `UNSAFE_componentDidMount()`, `componentDidMount` is the alias getter/setter.\n// - If anything assigns to an `UNSAFE_*` property, the assignment is forwarded to the unprefixed property.\n// See https://github.com/preactjs/preact/issues/1941\n[\n\t'componentWillMount',\n\t'componentWillReceiveProps',\n\t'componentWillUpdate'\n].forEach(key => {\n\tObject.defineProperty(Component.prototype, key, {\n\t\tconfigurable: true,\n\t\tget() {\n\t\t\treturn this['UNSAFE_' + key];\n\t\t},\n\t\tset(v) {\n\t\t\tObject.defineProperty(this, key, {\n\t\t\t\tconfigurable: true,\n\t\t\t\twritable: true,\n\t\t\t\tvalue: v\n\t\t\t});\n\t\t}\n\t});\n});\n\n/**\n * Proxy render() since React returns a Component reference.\n * @param {import('./internal').VNode} vnode VNode tree to render\n * @param {import('./internal').PreactElement} parent DOM node to render vnode tree into\n * @param {() => void} [callback] Optional callback that will be called after rendering\n * @returns {import('./internal').Component | null} The root component reference or null\n */\nexport function render(vnode, parent, callback) {\n\t// React destroys any existing DOM nodes, see #1727\n\t// ...but only on the first render, see #1828\n\tif (parent._children == null) {\n\t\tparent.textContent = '';\n\t}\n\n\tpreactRender(vnode, parent);\n\tif (typeof callback == 'function') callback();\n\n\treturn vnode ? vnode._component : null;\n}\n\nexport function hydrate(vnode, parent, callback) {\n\tpreactHydrate(vnode, parent);\n\tif (typeof callback == 'function') callback();\n\n\treturn vnode ? vnode._component : null;\n}\n\nlet oldEventHook = options.event;\noptions.event = e => {\n\tif (oldEventHook) e = oldEventHook(e);\n\n\te.persist = empty;\n\te.isPropagationStopped = isPropagationStopped;\n\te.isDefaultPrevented = isDefaultPrevented;\n\treturn (e.nativeEvent = e);\n};\n\nfunction empty() {}\n\nfunction isPropagationStopped() {\n\treturn this.cancelBubble;\n}\n\nfunction isDefaultPrevented() {\n\treturn this.defaultPrevented;\n}\n\nconst classNameDescriptorNonEnumberable = {\n\tenumerable: false,\n\tconfigurable: true,\n\tget() {\n\t\treturn this.class;\n\t}\n};\n\nfunction handleDomVNode(vnode) {\n\tlet props = vnode.props,\n\t\ttype = vnode.type,\n\t\tnormalizedProps = {};\n\n\tlet isNonDashedType = type.indexOf('-') === -1;\n\tfor (let i in props) {\n\t\tlet value = props[i];\n\n\t\tif (\n\t\t\t(i === 'value' && 'defaultValue' in props && value == null) ||\n\t\t\t// Emulate React's behavior of not rendering the contents of noscript tags on the client.\n\t\t\t(IS_DOM && i === 'children' && type === 'noscript') ||\n\t\t\ti === 'class' ||\n\t\t\ti === 'className'\n\t\t) {\n\t\t\t// Skip applying value if it is null/undefined and we already set\n\t\t\t// a default value\n\t\t\tcontinue;\n\t\t}\n\n\t\tlet lowerCased = i.toLowerCase();\n\t\tif (i === 'defaultValue' && 'value' in props && props.value == null) {\n\t\t\t// `defaultValue` is treated as a fallback `value` when a value prop is present but null/undefined.\n\t\t\t// `defaultValue` for Elements with no value prop is the same as the DOM defaultValue property.\n\t\t\ti = 'value';\n\t\t} else if (i === 'download' && value === true) {\n\t\t\t// Calling `setAttribute` with a truthy value will lead to it being\n\t\t\t// passed as a stringified value, e.g. `download=\"true\"`. React\n\t\t\t// converts it to an empty string instead, otherwise the attribute\n\t\t\t// value will be used as the file name and the file will be called\n\t\t\t// \"true\" upon downloading it.\n\t\t\tvalue = '';\n\t\t} else if (lowerCased === 'translate' && value === 'no') {\n\t\t\tvalue = false;\n\t\t} else if (lowerCased[0] === 'o' && lowerCased[1] === 'n') {\n\t\t\tif (lowerCased === 'ondoubleclick') {\n\t\t\t\ti = 'ondblclick';\n\t\t\t} else if (\n\t\t\t\tlowerCased === 'onchange' &&\n\t\t\t\t(type === 'input' || type === 'textarea') &&\n\t\t\t\t!onChangeInputType(props.type)\n\t\t\t) {\n\t\t\t\tlowerCased = i = 'oninput';\n\t\t\t} else if (lowerCased === 'onfocus') {\n\t\t\t\ti = 'onfocusin';\n\t\t\t} else if (lowerCased === 'onblur') {\n\t\t\t\ti = 'onfocusout';\n\t\t\t} else if (ON_ANI.test(i)) {\n\t\t\t\ti = lowerCased;\n\t\t\t}\n\t\t} else if (isNonDashedType && CAMEL_PROPS.test(i)) {\n\t\t\ti = i.replace(CAMEL_REPLACE, '-$&').toLowerCase();\n\t\t} else if (value === null) {\n\t\t\tvalue = undefined;\n\t\t}\n\n\t\t// Add support for onInput and onChange, see #3561\n\t\t// if we have an oninput prop already change it to oninputCapture\n\t\tif (lowerCased === 'oninput') {\n\t\t\ti = lowerCased;\n\t\t\tif (normalizedProps[i]) {\n\t\t\t\ti = 'oninputCapture';\n\t\t\t}\n\t\t}\n\n\t\tnormalizedProps[i] = value;\n\t}\n\n\t// Add support for array select values: <select multiple value={[]} />\n\tif (\n\t\ttype == 'select' &&\n\t\tnormalizedProps.multiple &&\n\t\tArray.isArray(normalizedProps.value)\n\t) {\n\t\t// forEach() always returns undefined, which we abuse here to unset the value prop.\n\t\tnormalizedProps.value = toChildArray(props.children).forEach(child => {\n\t\t\tchild.props.selected =\n\t\t\t\tnormalizedProps.value.indexOf(child.props.value) != -1;\n\t\t});\n\t}\n\n\t// Adding support for defaultValue in select tag\n\tif (type == 'select' && normalizedProps.defaultValue != null) {\n\t\tnormalizedProps.value = toChildArray(props.children).forEach(child => {\n\t\t\tif (normalizedProps.multiple) {\n\t\t\t\tchild.props.selected =\n\t\t\t\t\tnormalizedProps.defaultValue.indexOf(child.props.value) != -1;\n\t\t\t} else {\n\t\t\t\tchild.props.selected =\n\t\t\t\t\tnormalizedProps.defaultValue == child.props.value;\n\t\t\t}\n\t\t});\n\t}\n\n\tif (props.class && !props.className) {\n\t\tnormalizedProps.class = props.class;\n\t\tObject.defineProperty(\n\t\t\tnormalizedProps,\n\t\t\t'className',\n\t\t\tclassNameDescriptorNonEnumberable\n\t\t);\n\t} else if (props.className && !props.class) {\n\t\tnormalizedProps.class = normalizedProps.className = props.className;\n\t} else if (props.class && props.className) {\n\t\tnormalizedProps.class = normalizedProps.className = props.className;\n\t}\n\n\tvnode.props = normalizedProps;\n}\n\nlet oldVNodeHook = options.vnode;\noptions.vnode = vnode => {\n\t// only normalize props on Element nodes\n\tif (typeof vnode.type === 'string') {\n\t\thandleDomVNode(vnode);\n\t}\n\n\tvnode.$$typeof = REACT_ELEMENT_TYPE;\n\n\tif (oldVNodeHook) oldVNodeHook(vnode);\n};\n\n// Only needed for react-relay\nlet currentComponent;\nconst oldBeforeRender = options._render;\noptions._render = function (vnode) {\n\tif (oldBeforeRender) {\n\t\toldBeforeRender(vnode);\n\t}\n\tcurrentComponent = vnode._component;\n};\n\nconst oldDiffed = options.diffed;\n/** @type {(vnode: import('./internal').VNode) => void} */\noptions.diffed = function (vnode) {\n\tif (oldDiffed) {\n\t\toldDiffed(vnode);\n\t}\n\n\tconst props = vnode.props;\n\tconst dom = vnode._dom;\n\n\tif (\n\t\tdom != null &&\n\t\tvnode.type === 'textarea' &&\n\t\t'value' in props &&\n\t\tprops.value !== dom.value\n\t) {\n\t\tdom.value = props.value == null ? '' : props.value;\n\t}\n\n\tcurrentComponent = null;\n};\n\n// This is a very very private internal function for React it\n// is used to sort-of do runtime dependency injection.\nexport const __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = {\n\tReactCurrentDispatcher: {\n\t\tcurrent: {\n\t\t\treadContext(context) {\n\t\t\t\treturn currentComponent._globalContext[context._id].props.value;\n\t\t\t},\n\t\t\tuseCallback,\n\t\t\tuseContext,\n\t\t\tuseDebugValue,\n\t\t\tuseDeferredValue,\n\t\t\tuseEffect,\n\t\t\tuseId,\n\t\t\tuseImperativeHandle,\n\t\t\tuseInsertionEffect,\n\t\t\tuseLayoutEffect,\n\t\t\tuseMemo,\n\t\t\t// useMutableSource, // experimental-only and replaced by uSES, likely not worth supporting\n\t\t\tuseReducer,\n\t\t\tuseRef,\n\t\t\tuseState,\n\t\t\tuseSyncExternalStore,\n\t\t\tuseTransition\n\t\t}\n\t}\n};\n","import {\n\tcreateElement,\n\trender as preactRender,\n\tcloneElement as preactCloneElement,\n\tcreateRef,\n\tComponent,\n\tcreateContext,\n\tFragment\n} from 'preact';\nimport {\n\tuseState,\n\tuseId,\n\tuseReducer,\n\tuseEffect,\n\tuseLayoutEffect,\n\tuseRef,\n\tuseImperativeHandle,\n\tuseMemo,\n\tuseCallback,\n\tuseContext,\n\tuseDebugValue\n} from 'preact/hooks';\nimport {\n\tuseInsertionEffect,\n\tstartTransition,\n\tuseDeferredValue,\n\tuseSyncExternalStore,\n\tuseTransition\n} from './hooks';\nimport { PureComponent } from './PureComponent';\nimport { memo } from './memo';\nimport { forwardRef } from './forwardRef';\nimport { Children } from './Children';\nimport { Suspense, lazy } from './suspense';\nimport { SuspenseList } from './suspense-list';\nimport { createPortal } from './portals';\nimport {\n\thydrate,\n\trender,\n\tREACT_ELEMENT_TYPE,\n\t__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED\n} from './render';\n\nconst version = '18.3.1'; // trick libraries to think we are react\n\n/**\n * Legacy version of createElement.\n * @param {import('./internal').VNode[\"type\"]} type The node name or Component constructor\n */\nfunction createFactory(type) {\n\treturn createElement.bind(null, type);\n}\n\n/**\n * Check if the passed element is a valid (p)react node.\n * @param {*} element The element to check\n * @returns {boolean}\n */\nfunction isValidElement(element) {\n\treturn !!element && element.$$typeof === REACT_ELEMENT_TYPE;\n}\n\n/**\n * Check if the passed element is a Fragment node.\n * @param {*} element The element to check\n * @returns {boolean}\n */\nfunction isFragment(element) {\n\treturn isValidElement(element) && element.type === Fragment;\n}\n\n/**\n * Check if the passed element is a Memo node.\n * @param {*} element The element to check\n * @returns {boolean}\n */\nfunction isMemo(element) {\n\treturn (\n\t\t!!element &&\n\t\t!!element.displayName &&\n\t\t(typeof element.displayName === 'string' ||\n\t\t\telement.displayName instanceof String) &&\n\t\telement.displayName.startsWith('Memo(')\n\t);\n}\n\n/**\n * Wrap `cloneElement` to abort if the passed element is not a valid element and apply\n * all vnode normalizations.\n * @param {import('./internal').VNode} element The vnode to clone\n * @param {object} props Props to add when cloning\n * @param {Array<import('./internal').ComponentChildren>} rest Optional component children\n */\nfunction cloneElement(element) {\n\tif (!isValidElement(element)) return element;\n\treturn preactCloneElement.apply(null, arguments);\n}\n\n/**\n * Remove a component tree from the DOM, including state and event handlers.\n * @param {import('./internal').PreactElement} container\n * @returns {boolean}\n */\nfunction unmountComponentAtNode(container) {\n\tif (container._children) {\n\t\tpreactRender(null, container);\n\t\treturn true;\n\t}\n\treturn false;\n}\n\n/**\n * Get the matching DOM node for a component\n * @param {import('./internal').Component} component\n * @returns {import('./internal').PreactElement | null}\n */\nfunction findDOMNode(component) {\n\treturn (\n\t\t(component &&\n\t\t\t(component.base || (component.nodeType === 1 && component))) ||\n\t\tnull\n\t);\n}\n\n/**\n * Deprecated way to control batched rendering inside the reconciler, but we\n * already schedule in batches inside our rendering code\n * @template Arg\n * @param {(arg: Arg) => void} callback function that triggers the updated\n * @param {Arg} [arg] Optional argument that can be passed to the callback\n */\n// eslint-disable-next-line camelcase\nconst unstable_batchedUpdates = (callback, arg) => callback(arg);\n\n/**\n * In React, `flushSync` flushes the entire tree and forces a rerender. It's\n * implmented here as a no-op.\n * @template Arg\n * @template Result\n * @param {(arg: Arg) => Result} callback function that runs before the flush\n * @param {Arg} [arg] Optional argument that can be passed to the callback\n * @returns\n */\nconst flushSync = (callback, arg) => callback(arg);\n\n/**\n * Strict Mode is not implemented in Preact, so we provide a stand-in for it\n * that just renders its children without imposing any restrictions.\n */\nconst StrictMode = Fragment;\n\n// compat to react-is\nexport const isElement = isValidElement;\n\nexport * from 'preact/hooks';\nexport {\n\tversion,\n\tChildren,\n\trender,\n\thydrate,\n\tunmountComponentAtNode,\n\tcreatePortal,\n\tcreateElement,\n\tcreateContext,\n\tcreateFactory,\n\tcloneElement,\n\tcreateRef,\n\tFragment,\n\tisValidElement,\n\tisFragment,\n\tisMemo,\n\tfindDOMNode,\n\tComponent,\n\tPureComponent,\n\tmemo,\n\tforwardRef,\n\tflushSync,\n\tuseInsertionEffect,\n\tstartTransition,\n\tuseDeferredValue,\n\tuseSyncExternalStore,\n\tuseTransition,\n\t// eslint-disable-next-line camelcase\n\tunstable_batchedUpdates,\n\tStrictMode,\n\tSuspense,\n\tSuspenseList,\n\tlazy,\n\t__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED\n};\n\n// React copies the named exports to the default one.\nexport default {\n\tuseState,\n\tuseId,\n\tuseReducer,\n\tuseEffect,\n\tuseLayoutEffect,\n\tuseInsertionEffect,\n\tuseTransition,\n\tuseDeferredValue,\n\tuseSyncExternalStore,\n\tstartTransition,\n\tuseRef,\n\tuseImperativeHandle,\n\tuseMemo,\n\tuseCallback,\n\tuseContext,\n\tuseDebugValue,\n\tversion,\n\tChildren,\n\trender,\n\thydrate,\n\tunmountComponentAtNode,\n\tcreatePortal,\n\tcreateElement,\n\tcreateContext,\n\tcreateFactory,\n\tcloneElement,\n\tcreateRef,\n\tFragment,\n\tisValidElement,\n\tisElement,\n\tisFragment,\n\tisMemo,\n\tfindDOMNode,\n\tComponent,\n\tPureComponent,\n\tmemo,\n\tforwardRef,\n\tflushSync,\n\tunstable_batchedUpdates,\n\tStrictMode,\n\tSuspense,\n\tSuspenseList,\n\tlazy,\n\t__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED\n};\n","function r(e){var t,f,n=\"\";if(\"string\"==typeof e||\"number\"==typeof e)n+=e;else if(\"object\"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=\" \"),n+=f);else for(t in e)e[t]&&(n&&(n+=\" \"),n+=t);return n}export function clsx(){for(var e,t,f=0,n=\"\";f<arguments.length;)(e=arguments[f++])&&(t=r(e))&&(n&&(n+=\" \"),n+=t);return n}export default clsx;","import { options, Fragment } from 'preact';\nimport { encodeEntities } from './utils';\nimport { IS_NON_DIMENSIONAL } from '../../src/constants';\n\nlet vnodeId = 0;\n\nconst isArray = Array.isArray;\n\n/**\n * @fileoverview\n * This file exports various methods that implement Babel's \"automatic\" JSX runtime API:\n * - jsx(type, props, key)\n * - jsxs(type, props, key)\n * - jsxDEV(type, props, key, __source, __self)\n *\n * The implementation of createVNode here is optimized for performance.\n * Benchmarks: https://esbench.com/bench/5f6b54a0b4632100a7dcd2b3\n */\n\n/**\n * JSX.Element factory used by Babel's {runtime:\"automatic\"} JSX transform\n * @param {VNode['type']} type\n * @param {VNode['props']} props\n * @param {VNode['key']} [key]\n * @param {unknown} [isStaticChildren]\n * @param {unknown} [__source]\n * @param {unknown} [__self]\n */\nfunction createVNode(type, props, key, isStaticChildren, __source, __self) {\n\tif (!props) props = {};\n\t// We'll want to preserve `ref` in props to get rid of the need for\n\t// forwardRef components in the future, but that should happen via\n\t// a separate PR.\n\tlet normalizedProps = props,\n\t\tref,\n\t\ti;\n\n\tif ('ref' in normalizedProps) {\n\t\tnormalizedProps = {};\n\t\tfor (i in props) {\n\t\t\tif (i == 'ref') {\n\t\t\t\tref = props[i];\n\t\t\t} else {\n\t\t\t\tnormalizedProps[i] = props[i];\n\t\t\t}\n\t\t}\n\t}\n\n\t/** @type {VNode & { __source: any; __self: any }} */\n\tconst vnode = {\n\t\ttype,\n\t\tprops: normalizedProps,\n\t\tkey,\n\t\tref,\n\t\t_children: null,\n\t\t_parent: null,\n\t\t_depth: 0,\n\t\t_dom: null,\n\t\t_component: null,\n\t\tconstructor: undefined,\n\t\t_original: --vnodeId,\n\t\t_index: -1,\n\t\t_flags: 0,\n\t\t__source,\n\t\t__self\n\t};\n\n\t// If a Component VNode, check for and apply defaultProps.\n\t// Note: `type` is often a String, and can be `undefined` in development.\n\tif (typeof type === 'function' && (ref = type.defaultProps)) {\n\t\tfor (i in ref)\n\t\t\tif (normalizedProps[i] === undefined) {\n\t\t\t\tnormalizedProps[i] = ref[i];\n\t\t\t}\n\t}\n\n\tif (options.vnode) options.vnode(vnode);\n\treturn vnode;\n}\n\n/**\n * Create a template vnode. This function is not expected to be\n * used directly, but rather through a precompile JSX transform\n * @param {string[]} templates\n * @param {Array<string | null | VNode>} exprs\n * @returns {VNode}\n */\nfunction jsxTemplate(templates, ...exprs) {\n\tconst vnode = createVNode(Fragment, { tpl: templates, exprs });\n\t// Bypass render to string top level Fragment optimization\n\tvnode.key = vnode._vnode;\n\treturn vnode;\n}\n\nconst JS_TO_CSS = {};\nconst CSS_REGEX = /[A-Z]/g;\n\n/**\n * Unwrap potential signals.\n * @param {*} value\n * @returns {*}\n */\nfunction normalizeAttrValue(value) {\n\treturn value !== null &&\n\t\ttypeof value === 'object' &&\n\t\ttypeof value.valueOf === 'function'\n\t\t? value.valueOf()\n\t\t: value;\n}\n\n/**\n * Serialize an HTML attribute to a string. This function is not\n * expected to be used directly, but rather through a precompile\n * JSX transform\n * @param {string} name The attribute name\n * @param {*} value The attribute value\n * @returns {string}\n */\nfunction jsxAttr(name, value) {\n\tif (options.attr) {\n\t\tconst result = options.attr(name, value);\n\t\tif (typeof result === 'string') return result;\n\t}\n\n\tvalue = normalizeAttrValue(value);\n\n\tif (name === 'ref' || name === 'key') return '';\n\tif (name === 'style' && typeof value === 'object') {\n\t\tlet str = '';\n\t\tfor (let prop in value) {\n\t\t\tlet val = value[prop];\n\t\t\tif (val != null && val !== '') {\n\t\t\t\tconst name =\n\t\t\t\t\tprop[0] == '-'\n\t\t\t\t\t\t? prop\n\t\t\t\t\t\t: JS_TO_CSS[prop] ||\n\t\t\t\t\t\t\t(JS_TO_CSS[prop] = prop.replace(CSS_REGEX, '-$&').toLowerCase());\n\n\t\t\t\tlet suffix = ';';\n\t\t\t\tif (\n\t\t\t\t\ttypeof val === 'number' &&\n\t\t\t\t\t// Exclude custom-attributes\n\t\t\t\t\t!name.startsWith('--') &&\n\t\t\t\t\t!IS_NON_DIMENSIONAL.test(name)\n\t\t\t\t) {\n\t\t\t\t\tsuffix = 'px;';\n\t\t\t\t}\n\t\t\t\tstr = str + name + ':' + val + suffix;\n\t\t\t}\n\t\t}\n\t\treturn name + '=\"' + encodeEntities(str) + '\"';\n\t}\n\n\tif (\n\t\tvalue == null ||\n\t\tvalue === false ||\n\t\ttypeof value === 'function' ||\n\t\ttypeof value === 'object'\n\t) {\n\t\treturn '';\n\t} else if (value === true) return name;\n\n\treturn name + '=\"' + encodeEntities('' + value) + '\"';\n}\n\n/**\n * Escape a dynamic child passed to `jsxTemplate`. This function\n * is not expected to be used directly, but rather through a\n * precompile JSX transform\n * @param {*} value\n * @returns {string | null | VNode | Array<string | null | VNode>}\n */\nfunction jsxEscape(value) {\n\tif (\n\t\tvalue == null ||\n\t\ttypeof value === 'boolean' ||\n\t\ttypeof value === 'function'\n\t) {\n\t\treturn null;\n\t}\n\n\tif (typeof value === 'object') {\n\t\t// Check for VNode\n\t\tif (value.constructor === undefined) return value;\n\n\t\tif (isArray(value)) {\n\t\t\tfor (let i = 0; i < value.length; i++) {\n\t\t\t\tvalue[i] = jsxEscape(value[i]);\n\t\t\t}\n\t\t\treturn value;\n\t\t}\n\t}\n\n\treturn encodeEntities('' + value);\n}\n\nexport {\n\tcreateVNode as jsx,\n\tcreateVNode as jsxs,\n\tcreateVNode as jsxDEV,\n\tFragment,\n\t// precompiled JSX transform\n\tjsxTemplate,\n\tjsxAttr,\n\tjsxEscape\n};\n","function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n","import { css } from '@linaria/core';\n\nexport const cell = css`\n contain: strict;\n contain: size layout style paint;\n padding: 0 8px;\n border-right: 1px solid var(--border-color);\n border-bottom: 1px solid var(--border-color);\n background-color: inherit;\n\n white-space: nowrap;\n overflow: hidden;\n overflow: clip;\n text-overflow: ellipsis;\n\n &[aria-selected='true'] {\n box-shadow: inset 0 0 0 2px var(--selection-color);\n }\n`;\n\nexport const cellClassname = `rdg-cell ${cell}`;\n\nconst cellFrozen = css`\n position: sticky;\n // Should have a higher value than 0 to show up above unfrozen cells\n z-index: 1;\n`;\n\nexport const cellFrozenClassname = `rdg-cell-frozen ${cellFrozen}`;\n\nexport const cellFrozenLast = css`\n box-shadow: 2px 0 5px -2px rgba(136, 136, 136, 0.3);\n`;\n\nexport const cellFrozenLastClassname = `rdg-cell-frozen-last ${cellFrozenLast}`;\n","import { css } from '@linaria/core';\nimport { row } from './row';\n\nconst lightTheme = `\n --color: #000;\n --border-color: #ddd;\n --summary-border-color: #aaa;\n --background-color: hsl(0deg 0% 100%);\n --header-background-color: hsl(0deg 0% 97.5%);\n --row-hover-background-color: hsl(0deg 0% 96%);\n --row-selected-background-color: hsl(207deg 76% 92%);\n --row-selected-hover-background-color: hsl(207deg 76% 88%);\n\n --checkbox-color: hsl(207deg 100% 29%);\n --checkbox-focus-color: hsl(207deg 100% 69%);\n --checkbox-disabled-border-color: #ccc;\n --checkbox-disabled-background-color: #ddd;\n`;\n\nconst darkTheme = `\n --color: #ddd;\n --border-color: #444;\n --summary-border-color: #555;\n --background-color: hsl(0deg 0% 13%);\n --header-background-color: hsl(0deg 0% 10.5%);\n --row-hover-background-color: hsl(0deg 0% 9%);\n --row-selected-background-color: hsl(207deg 76% 42%);\n --row-selected-hover-background-color: hsl(207deg 76% 38%);\n\n --checkbox-color: hsl(207deg 100% 79%);\n --checkbox-focus-color: hsl(207deg 100% 89%);\n --checkbox-disabled-border-color: #000;\n --checkbox-disabled-background-color: #333;\n`;\n\nconst root = css`\n ${lightTheme}\n --selection-color: #66afe9;\n --font-size: 14px;\n\n // https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Positioning/Understanding_z_index/The_stacking_context\n // We set a stacking context so internal elements don't render on top of external components.\n contain: strict;\n contain: size layout style paint;\n content-visibility: auto;\n height: 350px;\n border: 1px solid var(--border-color);\n box-sizing: border-box;\n overflow: auto;\n user-select: none;\n background-color: var(--background-color);\n color: var(--color);\n font-size: var(--font-size);\n\n // set stacking context in safari\n @supports not (contain: strict) {\n position: relative;\n z-index: 0;\n }\n\n *,\n *::before,\n *::after {\n box-sizing: inherit;\n }\n\n &.rdg-dark {\n ${darkTheme}\n }\n\n @media (prefers-color-scheme: dark) {\n &:not(.rdg-light) {\n ${darkTheme}\n }\n }\n`;\n\nexport const rootClassname = `rdg ${root}`;\n\nconst focusSink = css`\n position: sticky;\n top: 0;\n left: 0;\n height: 0;\n width: 0;\n outline: 0;\n`;\n\nexport const focusSinkClassname = `rdg-focus-sink ${focusSink}`;\n\nconst viewportDragging = css`\n &.${row} {\n cursor: move;\n }\n`;\n\nexport const viewportDraggingClassname = `rdg-viewport-dragging ${viewportDragging}`;\n","import { css } from '@linaria/core';\nimport { cell, cellFrozenLast } from './cell';\n\nconst groupRow = css`\n &:not([aria-selected='true']) {\n background-color: var(--header-background-color);\n }\n\n > .${cell}:not(:last-child):not(.${cellFrozenLast}) {\n border-right: none;\n }\n`;\n\nexport const groupRowClassname = `rdg-group-row ${groupRow}`;\n\nconst groupRowSelected = css`\n &::after {\n content: '';\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n box-shadow: inset 0 0 0 2px var(--selection-color);\n pointer-events: none;\n z-index: 2;\n }\n\n > .${cell}:first-child {\n // preserve left border on the first frozen cell after scrolling to the right\n box-shadow: inset 2px 0 0 0 var(--selection-color);\n }\n`;\n\n// TODO: rename class\nexport const groupRowSelectedClassname = `rdg-group-row-selected ${groupRowSelected}`;\n","import { css } from '@linaria/core';\n\nconst headerRow = css`\n contain: strict;\n contain: size layout style paint;\n display: grid;\n grid-template-columns: var(--template-columns);\n grid-template-rows: var(--header-row-height);\n height: var(--header-row-height); // needed on Firefox\n line-height: var(--header-row-height);\n width: var(--row-width);\n position: sticky;\n top: 0;\n background-color: var(--header-background-color);\n font-weight: bold;\n z-index: 3;\n touch-action: none;\n`;\n\nexport const headerRowClassname = `rdg-header-row ${headerRow}`;\n","import { css } from '@linaria/core';\nimport { cell } from './cell';\n\nexport const row = css`\n contain: strict;\n contain: size layout style paint;\n display: grid;\n grid-template-rows: var(--row-height);\n grid-template-columns: var(--template-columns);\n position: absolute;\n left: 0;\n width: var(--row-width);\n height: var(--row-height); // needed on Firefox\n line-height: var(--row-height);\n background-color: var(--background-color);\n\n &:hover {\n background-color: var(--row-hover-background-color);\n }\n\n &[aria-selected='true'] {\n background-color: var(--row-selected-background-color);\n\n &:hover {\n background-color: var(--row-selected-hover-background-color);\n }\n }\n`;\n\nexport const rowClassname = `rdg-row ${row}`;\n\nconst summaryRow = css`\n position: sticky;\n z-index: 3;\n grid-template-rows: var(--summary-row-height);\n height: var(--summary-row-height); // needed on Firefox\n line-height: var(--summary-row-height);\n\n > .${cell} {\n border-top: 2px solid var(--summary-border-color);\n }\n`;\n\nexport const summaryRowClassname = `rdg-summary-row ${summaryRow}`;\n","import { useRef, useLayoutEffect } from 'react';\n\nexport function useFocusRef<T extends HTMLOrSVGElement>(isCellSelected: boolean) {\n const ref = useRef<T>(null);\n useLayoutEffect(() => {\n if (!isCellSelected) return;\n ref.current?.focus({ preventScroll: true });\n }, [isCellSelected]);\n\n return ref;\n}\n","import clsx from 'clsx';\nimport { css } from '@linaria/core';\nimport { useFocusRef } from '../hooks/useFocusRef';\n\nconst checkboxLabel = css`\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n margin-right: 1px; // align checkbox in row group cell\n`;\n\nconst checkboxLabelClassname = `rdg-checkbox-label ${checkboxLabel}`;\n\nconst checkboxInput = css`\n all: unset;\n width: 0;\n margin: 0;\n`;\n\nconst checkboxInputClassname = `rdg-checkbox-input ${checkboxInput}`;\n\nconst checkbox = css`\n content: '';\n width: 20px;\n height: 20px;\n border: 2px solid var(--border-color);\n background-color: var(--background-color);\n\n .${checkboxInput}:checked + & {\n background-color: var(--checkbox-color);\n box-shadow: inset 0px 0px 0px 4px var(--background-color);\n }\n\n .${checkboxInput}:focus + & {\n border-color: var(--checkbox-focus-color);\n }\n`;\n\nconst checkboxClassname = `rdg-checkbox ${checkbox}`;\n\nconst checkboxLabelDisabled = css`\n cursor: default;\n\n .${checkbox} {\n border-color: var(--checkbox-disabled-border-color);\n background-color: var(--checkbox-disabled-background-color);\n }\n`;\n\nconst checkboxLabelDisabledClassname = `rdg-checkbox-label-disabled ${checkboxLabelDisabled}`;\n\ntype SharedInputProps = Pick<\n React.InputHTMLAttributes<HTMLInputElement>,\n 'disabled' | 'tabIndex' | 'onClick' | 'aria-label' | 'aria-labelledby'\n>;\n\ninterface SelectCellFormatterProps extends SharedInputProps {\n isCellSelected: boolean;\n value: boolean;\n onChange: (value: boolean, isShiftClick: boolean) => void;\n}\n\nexport function SelectCellFormatter({\n value,\n tabIndex,\n isCellSelected,\n disabled,\n onClick,\n onChange,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy\n}: SelectCellFormatterProps) {\n const inputRef = useFocusRef<HTMLInputElement>(isCellSelected);\n\n function handleChange(e: React.ChangeEvent<HTMLInputElement>) {\n onChange(e.target.checked, (e.nativeEvent as MouseEvent).shiftKey);\n }\n\n return (\n <label className={clsx(checkboxLabelClassname, { [checkboxLabelDisabledClassname]: disabled })}>\n <input\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n tabIndex={tabIndex}\n ref={inputRef}\n type=\"checkbox\"\n className={checkboxInputClassname}\n disabled={disabled}\n checked={value}\n onChange={handleChange}\n onClick={onClick}\n />\n <div className={checkboxClassname} />\n </label>\n );\n}\n","import type { FormatterProps } from '../types';\n\nexport function ValueFormatter<R, SR>(props: FormatterProps<R, SR>) {\n try {\n return <>{props.row[props.column.key as keyof R]}</>;\n } catch {\n return null;\n }\n}\n","import { css } from '@linaria/core';\nimport type { GroupFormatterProps } from '../types';\nimport { useFocusRef } from '../hooks/useFocusRef';\n\nconst groupCellContent = css`\n outline: none;\n`;\n\nconst groupCellContentClassname = `rdg-group-cell-content ${groupCellContent}`;\n\nconst caret = css`\n margin-left: 4px;\n stroke: currentColor;\n stroke-width: 1.5px;\n fill: transparent;\n vertical-align: middle;\n\n > path {\n transition: d 0.1s;\n }\n`;\n\nconst caretClassname = `rdg-caret ${caret}`;\n\nexport function ToggleGroupFormatter<R, SR>({\n groupKey,\n isExpanded,\n isCellSelected,\n toggleGroup\n}: GroupFormatterProps<R, SR>) {\n const cellRef = useFocusRef<HTMLSpanElement>(isCellSelected);\n\n function handleKeyDown({ key }: React.KeyboardEvent<HTMLSpanElement>) {\n if (key === 'Enter') {\n toggleGroup();\n }\n }\n\n const d = isExpanded ? 'M1 1 L 7 7 L 13 1' : 'M1 7 L 7 1 L 13 7';\n\n return (\n <span\n ref={cellRef}\n className={groupCellContentClassname}\n tabIndex={-1}\n onKeyDown={handleKeyDown}\n >\n {groupKey}\n <svg viewBox=\"0 0 14 8\" width=\"14\" height=\"8\" className={caretClassname}>\n <path d={d} />\n </svg>\n </span>\n );\n}\n","import type { CalculatedColumn, ColSpanArgs } from '../types';\n\nexport function getColSpan<R, SR>(\n column: CalculatedColumn<R, SR>,\n lastFrozenColumnIndex: number,\n args: ColSpanArgs<R, SR>\n): number | undefined {\n const colSpan = typeof column.colSpan === 'function' ? column.colSpan(args) : 1;\n if (\n Number.isInteger(colSpan) &&\n colSpan! > 1 &&\n // ignore colSpan if it spans over both frozen and regular columns\n (!column.frozen || column.idx + colSpan! - 1 <= lastFrozenColumnIndex)\n ) {\n return colSpan!;\n }\n return undefined;\n}\n","export function stopPropagation(event: React.SyntheticEvent) {\n event.stopPropagation();\n}\n","// https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values\nconst nonInputKeys = new Set([\n // Special keys\n 'Unidentified',\n // Modifier keys\n 'Alt',\n 'AltGraph',\n 'CapsLock',\n 'Control',\n 'Fn',\n 'FnLock',\n 'Meta',\n 'NumLock',\n 'ScrollLock',\n 'Shift',\n // Whitespace keys\n 'Tab',\n // Navigation keys\n 'ArrowDown',\n 'ArrowLeft',\n 'ArrowRight',\n 'ArrowUp',\n 'End',\n 'Home',\n 'PageDown',\n 'PageUp',\n // Editing\n 'Insert',\n // UI keys\n 'ContextMenu',\n 'Escape',\n 'Pause',\n 'Play',\n // Device keys\n 'PrintScreen',\n // Function keys\n 'F1',\n // 'F2', /!\\ specifically allowed, do not edit\n 'F3',\n 'F4',\n 'F5',\n 'F6',\n 'F7',\n 'F8',\n 'F9',\n 'F10',\n 'F11',\n 'F12'\n]);\n\nexport function isCtrlKeyHeldDown(e: React.KeyboardEvent): boolean {\n return (e.ctrlKey || e.metaKey) && e.key !== 'Control';\n}\n\nexport function isDefaultCellInput(event: React.KeyboardEvent<HTMLDivElement>): boolean {\n return !nonInputKeys.has(event.key);\n}\n\n/**\n * By default, the following navigation keys are enabled while an editor is open, under specific conditions:\n * - Tab:\n * - The editor must be an <input>, a <textarea>, or a <select> element.\n * - The editor element must be the only immediate child of the editor container/a label.\n */\nexport function onEditorNavigation({ key, target }: React.KeyboardEvent<HTMLDivElement>): boolean {\n if (\n key === 'Tab' &&\n (target instanceof HTMLInputElement ||\n target instanceof HTMLTextAreaElement ||\n target instanceof HTMLSelectElement)\n ) {\n return target.matches(\n '.rdg-editor-container > :only-child, .rdg-editor-container > label:only-child > :only-child'\n );\n }\n return false;\n}\n","import type { CalculatedColumn, Position, GroupRow, CellNavigationMode } from '../types';\nimport { getColSpan } from './colSpanUtils';\n\ninterface IsSelectedCellEditableOpts<R, SR> {\n selectedPosition: Position;\n columns: readonly CalculatedColumn<R, SR>[];\n rows: readonly (R | GroupRow<R>)[];\n isGroupRow: (row: R | GroupRow<R>) => row is GroupRow<R>;\n}\n\nexport function isSelectedCellEditable<R, SR>({\n selectedPosition,\n columns,\n rows,\n isGroupRow\n}: IsSelectedCellEditableOpts<R, SR>): boolean {\n const column = columns[selectedPosition.idx];\n const row = rows[selectedPosition.rowIdx];\n return !isGroupRow(row) && isCellEditable(column, row);\n}\n\nexport function isCellEditable<R, SR>(column: CalculatedColumn<R, SR>, row: R): boolean {\n return (\n column.editor != null &&\n !column.rowGroup &&\n (typeof column.editable === 'function' ? column.editable(row) : column.editable) !== false\n );\n}\n\ninterface GetNextSelectedCellPositionOpts<R, SR> {\n cellNavigationMode: CellNavigationMode;\n columns: readonly CalculatedColumn<R, SR>[];\n colSpanColumns: readonly CalculatedColumn<R, SR>[];\n rows: readonly (R | GroupRow<R>)[];\n currentPosition: Readonly<Position>;\n nextPosition: Position;\n lastFrozenColumnIndex: number;\n isCellWithinBounds: (position: Position) => boolean;\n isGroupRow: (row: R | GroupRow<R>) => row is GroupRow<R>;\n}\n\nexport function getNextSelectedCellPosition<R, SR>({\n cellNavigationMode,\n columns,\n colSpanColumns,\n rows,\n currentPosition,\n nextPosition,\n lastFrozenColumnIndex,\n isCellWithinBounds,\n isGroupRow\n}: GetNextSelectedCellPositionOpts<R, SR>): Position {\n const rowsCount = rows.length;\n let position = nextPosition;\n\n const setColSpan = (moveRight: boolean) => {\n const row = rows[position.rowIdx];\n if (!isGroupRow(row)) {\n // If a cell within the colspan range is selected then move to the\n // previous or the next cell depending on the navigation direction\n const posIdx = position.idx;\n for (const column of colSpanColumns) {\n const colIdx = column.idx;\n if (colIdx > posIdx) break;\n const colSpan = getColSpan(column, lastFrozenColumnIndex, { type: 'ROW', row });\n if (colSpan && posIdx > colIdx && posIdx < colSpan + colIdx) {\n position.idx = colIdx + (moveRight ? colSpan : 0);\n break;\n }\n }\n }\n };\n\n if (isCellWithinBounds(position)) {\n setColSpan(position.idx - currentPosition.idx > 0);\n }\n\n if (cellNavigationMode !== 'NONE') {\n const { idx, rowIdx } = nextPosition;\n const columnsCount = columns.length;\n const isAfterLastColumn = idx === columnsCount;\n const isBeforeFirstColumn = idx === -1;\n\n if (isAfterLastColumn) {\n if (cellNavigationMode === 'CHANGE_ROW') {\n const isLastRow = rowIdx === rowsCount - 1;\n if (!isLastRow) {\n position = {\n idx: 0,\n rowIdx: rowIdx + 1\n };\n }\n } else {\n position = {\n rowIdx,\n idx: 0\n };\n }\n setColSpan(true);\n } else if (isBeforeFirstColumn) {\n if (cellNavigationMode === 'CHANGE_ROW') {\n const isFirstRow = rowIdx === 0;\n if (!isFirstRow) {\n position = {\n rowIdx: rowIdx - 1,\n idx: columnsCount - 1\n };\n }\n } else {\n position = {\n rowIdx,\n idx: columnsCount - 1\n };\n }\n }\n setColSpan(false);\n }\n\n return position;\n}\n\ninterface CanExitGridOpts<R, SR> {\n cellNavigationMode: CellNavigationMode;\n columns: readonly CalculatedColumn<R, SR>[];\n rowsCount: number;\n selectedPosition: Position;\n shiftKey: boolean;\n}\n\nexport function canExitGrid<R, SR>({\n cellNavigationMode,\n columns,\n rowsCount,\n selectedPosition: { rowIdx, idx },\n shiftKey\n}: CanExitGridOpts<R, SR>): boolean {\n // When the cellNavigationMode is 'none' or 'changeRow', you can exit the grid if you're at the first or last cell of the grid\n // When the cellNavigationMode is 'loopOverRow', there is no logical exit point so you can't exit the grid\n if (cellNavigationMode === 'NONE' || cellNavigationMode === 'CHANGE_ROW') {\n const atLastCellInRow = idx === columns.length - 1;\n const atFirstCellInRow = idx === 0;\n const atLastRow = rowIdx === rowsCount - 1;\n const atFirstRow = rowIdx === 0;\n\n return shiftKey ? atFirstCellInRow && atFirstRow : atLastCellInRow && atLastRow;\n }\n\n return false;\n}\n","import clsx from 'clsx';\n\nimport type { CalculatedColumn } from '../types';\nimport { cellClassname, cellFrozenClassname, cellFrozenLastClassname } from '../style';\n\nexport * from './colSpanUtils';\nexport * from './domUtils';\nexport * from './keyboardUtils';\nexport * from './selectedCellUtils';\n\nexport const { min, max, floor, ceil, sign } = Math;\n\nexport function assertIsValidKeyGetter<R, K extends React.Key>(\n keyGetter: unknown\n): asserts keyGetter is (row: R) => K {\n if (typeof keyGetter !== 'function') {\n throw new Error('Please specify the rowKeyGetter prop to use selection');\n }\n}\n\nexport function getCellStyle<R, SR>(\n column: CalculatedColumn<R, SR>,\n colSpan?: number\n): React.CSSProperties {\n return {\n gridColumnStart: column.idx + 1,\n gridColumnEnd: colSpan !== undefined ? `span ${colSpan}` : undefined,\n left: column.frozen ? `var(--frozen-left-${column.key})` : undefined\n };\n}\n\nexport function getCellClassname<R, SR>(\n column: CalculatedColumn<R, SR>,\n ...extraClasses: Parameters<typeof clsx>\n): string {\n return clsx(\n cellClassname,\n {\n [cellFrozenClassname]: column.frozen,\n [cellFrozenLastClassname]: column.isLastFrozenColumn\n },\n ...extraClasses\n );\n}\n","import { SelectCellFormatter } from './formatters';\nimport { useRowSelection } from './hooks';\nimport type { Column, FormatterProps, GroupFormatterProps } from './types';\nimport { stopPropagation } from './utils';\n\nexport const SELECT_COLUMN_KEY = 'select-row';\n\nfunction SelectFormatter(props: FormatterProps<unknown>) {\n const [isRowSelected, onRowSelectionChange] = useRowSelection();\n\n return (\n <SelectCellFormatter\n aria-label=\"Select\"\n tabIndex={-1}\n isCellSelected={props.isCellSelected}\n value={isRowSelected}\n onClick={stopPropagation}\n onChange={(checked, isShiftClick) => {\n onRowSelectionChange({ rowIdx: props.rowIdx, checked, isShiftClick });\n }}\n />\n );\n}\n\nfunction SelectGroupFormatter(props: GroupFormatterProps<unknown>) {\n const [isRowSelected, onRowSelectionChange] = useRowSelection();\n\n return (\n <SelectCellFormatter\n aria-label=\"Select Group\"\n tabIndex={-1}\n isCellSelected={props.isCellSelected}\n value={isRowSelected}\n onChange={(checked) => {\n onRowSelectionChange({ checked, isShiftClick: false, rowIdx: props.rowIdx });\n }}\n // Stop propagation to prevent row selection\n onClick={stopPropagation}\n />\n );\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const SelectColumn: Column<any, any> = {\n key: SELECT_COLUMN_KEY,\n name: '',\n width: 35,\n maxWidth: 35,\n resizable: false,\n sortable: false,\n frozen: true,\n headerRenderer(props) {\n return (\n <SelectCellFormatter\n aria-label=\"Select All\"\n isCellSelected={false}\n value={props.allRowsSelected}\n onChange={props.onAllRowsSelectionChange}\n />\n );\n },\n formatter: SelectFormatter,\n groupFormatter: SelectGroupFormatter\n};\n","import { useMemo } from 'react';\n\nimport type { CalculatedColumn, Column, ColumnMetric } from '../types';\nimport type { DataGridProps } from '../DataGrid';\nimport { ValueFormatter, ToggleGroupFormatter } from '../formatters';\nimport { SELECT_COLUMN_KEY } from '../Columns';\nimport { floor, max, min } from '../utils';\n\ninterface CalculatedColumnsArgs<R, SR> extends Pick<DataGridProps<R, SR>, 'defaultColumnOptions'> {\n rawColumns: readonly Column<R, SR>[];\n rawGroupBy: readonly string[] | undefined | null;\n viewportWidth: number;\n scrollLeft: number;\n columnWidths: ReadonlyMap<string, number>;\n enableVirtualization: boolean;\n}\n\nexport function useCalculatedColumns<R, SR>({\n rawColumns,\n columnWidths,\n viewportWidth,\n scrollLeft,\n defaultColumnOptions,\n rawGroupBy,\n enableVirtualization\n}: CalculatedColumnsArgs<R, SR>) {\n const minColumnWidth = defaultColumnOptions?.minWidth ?? 80;\n const defaultFormatter = defaultColumnOptions?.formatter ?? ValueFormatter;\n const defaultSortable = defaultColumnOptions?.sortable ?? false;\n const defaultResizable = defaultColumnOptions?.resizable ?? false;\n\n const { columns, colSpanColumns, lastFrozenColumnIndex, groupBy } = useMemo(() => {\n // Filter rawGroupBy and ignore keys that do not match the columns prop\n const groupBy: string[] = [];\n let lastFrozenColumnIndex = -1;\n\n const columns = rawColumns.map((rawColumn) => {\n const rowGroup = rawGroupBy?.includes(rawColumn.key) ?? false;\n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing\n const frozen = rowGroup || rawColumn.frozen || false;\n\n const column: CalculatedColumn<R, SR> = {\n ...rawColumn,\n idx: 0,\n frozen,\n isLastFrozenColumn: false,\n rowGroup,\n sortable: rawColumn.sortable ?? defaultSortable,\n resizable: rawColumn.resizable ?? defaultResizable,\n formatter: rawColumn.formatter ?? defaultFormatter\n };\n\n if (rowGroup) {\n column.groupFormatter ??= ToggleGroupFormatter;\n }\n\n if (frozen) {\n lastFrozenColumnIndex++;\n }\n\n return column;\n });\n\n columns.sort(({ key: aKey, frozen: frozenA }, { key: bKey, frozen: frozenB }) => {\n // Sort select column first:\n if (aKey === SELECT_COLUMN_KEY) return -1;\n if (bKey === SELECT_COLUMN_KEY) return 1;\n\n // Sort grouped columns second, following the groupBy order:\n if (rawGroupBy?.includes(aKey)) {\n if (rawGroupBy.includes(bKey)) {\n return rawGroupBy.indexOf(aKey) - rawGroupBy.indexOf(bKey);\n }\n return -1;\n }\n if (rawGroupBy?.includes(bKey)) return 1;\n\n // Sort frozen columns third:\n if (frozenA) {\n if (frozenB) return 0;\n return -1;\n }\n if (frozenB) return 1;\n\n // Sort other columns last:\n return 0;\n });\n\n const colSpanColumns: CalculatedColumn<R, SR>[] = [];\n columns.forEach((column, idx) => {\n column.idx = idx;\n\n if (column.rowGroup) {\n groupBy.push(column.key);\n }\n\n if (column.colSpan != null) {\n colSpanColumns.push(column);\n }\n });\n\n if (lastFrozenColumnIndex !== -1) {\n columns[lastFrozenColumnIndex].isLastFrozenColumn = true;\n }\n\n return {\n columns,\n colSpanColumns,\n lastFrozenColumnIndex,\n groupBy\n };\n }, [rawColumns, defaultFormatter, defaultResizable, defaultSortable, rawGroupBy]);\n\n const { layoutCssVars, totalColumnWidth, totalFrozenColumnWidth, columnMetrics } = useMemo(() => {\n const columnMetrics = new Map<CalculatedColumn<R, SR>, ColumnMetric>();\n let left = 0;\n let totalColumnWidth = 0;\n let totalFrozenColumnWidth = 0;\n let templateColumns = '';\n let allocatedWidth = 0;\n let unassignedColumnsCount = 0;\n\n for (const column of columns) {\n let width = getSpecifiedWidth(column, columnWidths, viewportWidth);\n\n if (width === undefined) {\n unassignedColumnsCount++;\n } else {\n width = clampColumnWidth(width, column, minColumnWidth);\n allocatedWidth += width;\n columnMetrics.set(column, { width, left: 0 });\n }\n }\n\n const unallocatedWidth = viewportWidth - allocatedWidth;\n const unallocatedColumnWidth = unallocatedWidth / unassignedColumnsCount;\n\n for (const column of columns) {\n let width: number;\n if (columnMetrics.has(column)) {\n const columnMetric = columnMetrics.get(column)!;\n columnMetric.left = left;\n ({ width } = columnMetric);\n } else {\n width = clampColumnWidth(unallocatedColumnWidth, column, minColumnWidth);\n columnMetrics.set(column, { width, left });\n }\n totalColumnWidth += width;\n left += width;\n templateColumns += `${width}px `;\n }\n\n if (lastFrozenColumnIndex !== -1) {\n const columnMetric = columnMetrics.get(columns[lastFrozenColumnIndex])!;\n totalFrozenColumnWidth = columnMetric.left + columnMetric.width;\n }\n\n const layoutCssVars: Record<string, string> = {\n '--template-columns': templateColumns\n };\n\n for (let i = 0; i <= lastFrozenColumnIndex; i++) {\n const column = columns[i];\n layoutCssVars[`--frozen-left-${column.key}`] = `${columnMetrics.get(column)!.left}px`;\n }\n\n return { layoutCssVars, totalColumnWidth, totalFrozenColumnWidth, columnMetrics };\n }, [columnWidths, columns, viewportWidth, minColumnWidth, lastFrozenColumnIndex]);\n\n const [colOverscanStartIdx, colOverscanEndIdx] = useMemo((): [number, number] => {\n if (!enableVirtualization) {\n return [0, columns.length - 1];\n }\n // get the viewport's left side and right side positions for non-frozen columns\n const viewportLeft = scrollLeft + totalFrozenColumnWidth;\n const viewportRight = scrollLeft + viewportWidth;\n // get first and last non-frozen column indexes\n const lastColIdx = columns.length - 1;\n const firstUnfrozenColumnIdx = min(lastFrozenColumnIndex + 1, lastColIdx);\n\n // skip rendering non-frozen columns if the frozen columns cover the entire viewport\n if (viewportLeft >= viewportRight) {\n return [firstUnfrozenColumnIdx, firstUnfrozenColumnIdx];\n }\n\n // get the first visible non-frozen column index\n let colVisibleStartIdx = firstUnfrozenColumnIdx;\n while (colVisibleStartIdx < lastColIdx) {\n const { left, width } = columnMetrics.get(columns[colVisibleStartIdx])!;\n // if the right side of the columnn is beyond the left side of the available viewport,\n // then it is the first column that's at least partially visible\n if (left + width > viewportLeft) {\n break;\n }\n colVisibleStartIdx++;\n }\n\n // get the last visible non-frozen column index\n let colVisibleEndIdx = colVisibleStartIdx;\n while (colVisibleEndIdx < lastColIdx) {\n const { left, width } = columnMetrics.get(columns[colVisibleEndIdx])!;\n // if the right side of the column is beyond or equal to the right side of the available viewport,\n // then it the last column that's at least partially visible, as the previous column's right side is not beyond the viewport.\n if (left + width >= viewportRight) {\n break;\n }\n colVisibleEndIdx++;\n }\n\n const colOverscanStartIdx = max(firstUnfrozenColumnIdx, colVisibleStartIdx - 1);\n const colOverscanEndIdx = min(lastColIdx, colVisibleEndIdx + 1);\n\n return [colOverscanStartIdx, colOverscanEndIdx];\n }, [\n columnMetrics,\n columns,\n lastFrozenColumnIndex,\n scrollLeft,\n totalFrozenColumnWidth,\n viewportWidth,\n enableVirtualization\n ]);\n\n return {\n columns,\n colSpanColumns,\n colOverscanStartIdx,\n colOverscanEndIdx,\n layoutCssVars,\n columnMetrics,\n totalColumnWidth,\n lastFrozenColumnIndex,\n totalFrozenColumnWidth,\n groupBy\n };\n}\n\nfunction getSpecifiedWidth<R, SR>(\n { key, width }: Column<R, SR>,\n columnWidths: ReadonlyMap<string, number>,\n viewportWidth: number\n): number | undefined {\n if (columnWidths.has(key)) {\n // Use the resized width if available\n return columnWidths.get(key);\n }\n if (typeof width === 'number') {\n return width;\n }\n if (typeof width === 'string' && /^\\d+%$/.test(width)) {\n return floor((viewportWidth * parseInt(width, 10)) / 100);\n }\n return undefined;\n}\n\nfunction clampColumnWidth<R, SR>(\n width: number,\n { minWidth, maxWidth }: Column<R, SR>,\n minColumnWidth: number\n): number {\n width = max(width, minWidth ?? minColumnWidth);\n\n if (typeof maxWidth === 'number') {\n return min(width, maxWidth);\n }\n\n return width;\n}\n","import { useRef, useState, useLayoutEffect } from 'react';\n\nexport function useGridDimensions(): [\n ref: React.RefObject<HTMLDivElement>,\n width: number,\n height: number\n] {\n const gridRef = useRef<HTMLDivElement>(null);\n const [gridWidth, setGridWidth] = useState(1);\n const [gridHeight, setGridHeight] = useState(1);\n\n useLayoutEffect(() => {\n const { ResizeObserver } = window;\n\n // don't break in jest/jsdom and browsers that don't support ResizeObserver\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n if (ResizeObserver == null) return;\n\n const resizeObserver = new ResizeObserver(() => {\n // Get dimensions without scrollbars.\n // The dimensions given by the callback entries in Firefox do not substract the scrollbar sizes.\n const { clientWidth, clientHeight } = gridRef.current!;\n // TODO: remove once fixed upstream\n // we reduce width by 1px here to avoid layout issues in Chrome\n // https://bugs.chromium.org/p/chromium/issues/detail?id=1206298\n setGridWidth(clientWidth - (devicePixelRatio % 0.5 === 0 ? 0 : 1));\n setGridHeight(clientHeight);\n });\n\n resizeObserver.observe(gridRef.current!);\n\n return () => {\n resizeObserver.disconnect();\n };\n }, []);\n\n return [gridRef, gridWidth, gridHeight];\n}\n","import { useRef, useEffect, useCallback } from 'react';\n\n// https://reactjs.org/docs/hooks-faq.html#what-can-i-do-if-my-effect-dependencies-change-too-often\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function useLatestFunc<T extends (...args: any[]) => any>(fn: T) {\n const ref = useRef(fn);\n\n useEffect(() => {\n ref.current = fn;\n });\n\n return useCallback((...args: Parameters<T>) => {\n ref.current(...args);\n }, []);\n}\n","import { createContext, useContext } from 'react';\nimport type { SelectRowEvent } from '../types';\n\nconst RowSelectionContext = createContext<boolean | undefined>(undefined);\n\nexport const RowSelectionProvider = RowSelectionContext.Provider;\n\nconst RowSelectionChangeContext =\n createContext<((selectRowEvent: SelectRowEvent) => void) | undefined>(undefined);\n\nexport const RowSelectionChangeProvider = RowSelectionChangeContext.Provider;\n\nexport function useRowSelection(): [boolean, (selectRowEvent: SelectRowEvent) => void] {\n const rowSelectionContext = useContext(RowSelectionContext);\n const rowSelectionChangeContext = useContext(RowSelectionChangeContext);\n\n if (rowSelectionContext === undefined || rowSelectionChangeContext === undefined) {\n throw new Error('useRowSelection must be used within DataGrid cells');\n }\n\n return [rowSelectionContext, rowSelectionChangeContext];\n}\n","import { useMemo } from 'react';\n\nimport { getColSpan } from '../utils';\nimport type { CalculatedColumn, GroupRow } from '../types';\n\ninterface ViewportColumnsArgs<R, SR> {\n columns: readonly CalculatedColumn<R, SR>[];\n colSpanColumns: readonly CalculatedColumn<R, SR>[];\n rows: readonly (R | GroupRow<R>)[];\n summaryRows: readonly SR[] | undefined | null;\n colOverscanStartIdx: number;\n colOverscanEndIdx: number;\n lastFrozenColumnIndex: number;\n rowOverscanStartIdx: number;\n rowOverscanEndIdx: number;\n isGroupRow: (row: R | GroupRow<R>) => row is GroupRow<R>;\n}\n\nexport function useViewportColumns<R, SR>({\n columns,\n colSpanColumns,\n rows,\n summaryRows,\n colOverscanStartIdx,\n colOverscanEndIdx,\n lastFrozenColumnIndex,\n rowOverscanStartIdx,\n rowOverscanEndIdx,\n isGroupRow\n}: ViewportColumnsArgs<R, SR>) {\n // find the column that spans over a column within the visible columns range and adjust colOverscanStartIdx\n const startIdx = useMemo(() => {\n if (colOverscanStartIdx === 0) return 0;\n\n let startIdx = colOverscanStartIdx;\n\n const updateStartIdx = (colIdx: number, colSpan: number | undefined) => {\n if (colSpan !== undefined && colIdx + colSpan > colOverscanStartIdx) {\n startIdx = colIdx;\n return true;\n }\n return false;\n };\n\n for (const column of colSpanColumns) {\n // check header row\n const colIdx = column.idx;\n if (colIdx >= startIdx) break;\n if (updateStartIdx(colIdx, getColSpan(column, lastFrozenColumnIndex, { type: 'HEADER' }))) {\n break;\n }\n\n // check viewport rows\n for (let rowIdx = rowOverscanStartIdx; rowIdx <= rowOverscanEndIdx; rowIdx++) {\n const row = rows[rowIdx];\n if (isGroupRow(row)) continue;\n if (\n updateStartIdx(colIdx, getColSpan(column, lastFrozenColumnIndex, { type: 'ROW', row }))\n ) {\n break;\n }\n }\n\n // check summary rows\n if (summaryRows != null) {\n for (const row of summaryRows) {\n if (\n updateStartIdx(\n colIdx,\n getColSpan(column, lastFrozenColumnIndex, { type: 'SUMMARY', row })\n )\n ) {\n break;\n }\n }\n }\n }\n\n return startIdx;\n }, [\n rowOverscanStartIdx,\n rowOverscanEndIdx,\n rows,\n summaryRows,\n colOverscanStartIdx,\n lastFrozenColumnIndex,\n colSpanColumns,\n isGroupRow\n ]);\n\n return useMemo((): readonly CalculatedColumn<R, SR>[] => {\n const viewportColumns: CalculatedColumn<R, SR>[] = [];\n for (let colIdx = 0; colIdx <= colOverscanEndIdx; colIdx++) {\n const column = columns[colIdx];\n\n if (colIdx < startIdx && !column.frozen) continue;\n viewportColumns.push(column);\n }\n\n return viewportColumns;\n }, [startIdx, colOverscanEndIdx, columns]);\n}\n","import { useMemo } from 'react';\nimport { ceil, floor, max, min } from '../utils';\nimport type { GroupRow, GroupByDictionary, RowHeightArgs } from '../types';\n\nconst RENDER_BATCH_SIZE = 8;\n\ninterface ViewportRowsArgs<R> {\n rawRows: readonly R[];\n rowHeight: number | ((args: RowHeightArgs<R>) => number);\n clientHeight: number;\n scrollTop: number;\n groupBy: readonly string[];\n rowGrouper:\n | ((rows: readonly R[], columnKey: string) => Record<string, readonly R[]>)\n | undefined\n | null;\n expandedGroupIds: ReadonlySet<unknown> | undefined | null;\n enableVirtualization: boolean;\n}\n\n// https://github.com/microsoft/TypeScript/issues/41808\nfunction isReadonlyArray(arr: unknown): arr is readonly unknown[] {\n return Array.isArray(arr);\n}\n\nexport function useViewportRows<R>({\n rawRows,\n rowHeight,\n clientHeight,\n scrollTop,\n groupBy,\n rowGrouper,\n expandedGroupIds,\n enableVirtualization\n}: ViewportRowsArgs<R>) {\n const [groupedRows, rowsCount] = useMemo(() => {\n if (groupBy.length === 0 || rowGrouper == null) return [undefined, rawRows.length];\n\n const groupRows = (\n rows: readonly R[],\n [groupByKey, ...remainingGroupByKeys]: readonly string[],\n startRowIndex: number\n ): [GroupByDictionary<R>, number] => {\n let groupRowsCount = 0;\n const groups: GroupByDictionary<R> = {};\n for (const [key, childRows] of Object.entries(rowGrouper(rows, groupByKey))) {\n // Recursively group each parent group\n const [childGroups, childRowsCount] =\n remainingGroupByKeys.length === 0\n ? [childRows, childRows.length]\n : groupRows(childRows, remainingGroupByKeys, startRowIndex + groupRowsCount + 1); // 1 for parent row\n groups[key] = { childRows, childGroups, startRowIndex: startRowIndex + groupRowsCount };\n groupRowsCount += childRowsCount + 1; // 1 for parent row\n }\n\n return [groups, groupRowsCount];\n };\n\n return groupRows(rawRows, groupBy, 0);\n }, [groupBy, rowGrouper, rawRows]);\n\n const [rows, isGroupRow] = useMemo(() => {\n const allGroupRows = new Set<unknown>();\n if (!groupedRows) return [rawRows, isGroupRow];\n\n const flattenedRows: Array<R | GroupRow<R>> = [];\n const expandGroup = (\n rows: GroupByDictionary<R> | readonly R[],\n parentId: string | undefined,\n level: number\n ): void => {\n if (isReadonlyArray(rows)) {\n flattenedRows.push(...rows);\n return;\n }\n Object.keys(rows).forEach((groupKey, posInSet, keys) => {\n // TODO: should users have control over the generated key?\n const id = parentId !== undefined ? `${parentId}__${groupKey}` : groupKey;\n const isExpanded = expandedGroupIds?.has(id) ?? false;\n const { childRows, childGroups, startRowIndex } = rows[groupKey];\n\n const groupRow: GroupRow<R> = {\n id,\n parentId,\n groupKey,\n isExpanded,\n childRows,\n level,\n posInSet,\n startRowIndex,\n setSize: keys.length\n };\n flattenedRows.push(groupRow);\n allGroupRows.add(groupRow);\n\n if (isExpanded) {\n expandGroup(childGroups, id, level + 1);\n }\n });\n };\n\n expandGroup(groupedRows, undefined, 0);\n return [flattenedRows, isGroupRow];\n\n function isGroupRow(row: R | GroupRow<R>): row is GroupRow<R> {\n return allGroupRows.has(row);\n }\n }, [expandedGroupIds, groupedRows, rawRows]);\n\n const { totalRowHeight, getRowTop, getRowHeight, findRowIdx } = useMemo(() => {\n if (typeof rowHeight === 'number') {\n return {\n totalRowHeight: rowHeight * rows.length,\n getRowTop: (rowIdx: number) => rowIdx * rowHeight,\n getRowHeight: () => rowHeight,\n findRowIdx: (offset: number) => floor(offset / rowHeight)\n };\n }\n\n let totalRowHeight = 0;\n // Calcule the height of all the rows upfront. This can cause performance issues\n // and we can consider using a similar approach as react-window\n // https://github.com/bvaughn/react-window/blob/master/src/VariableSizeList.js#L68\n const rowPositions = rows.map((row: R | GroupRow<R>) => {\n const currentRowHeight = isGroupRow(row)\n ? rowHeight({ type: 'GROUP', row })\n : rowHeight({ type: 'ROW', row });\n const position = { top: totalRowHeight, height: currentRowHeight };\n totalRowHeight += currentRowHeight;\n return position;\n });\n\n const validateRowIdx = (rowIdx: number) => {\n return max(0, min(rows.length - 1, rowIdx));\n };\n\n return {\n totalRowHeight,\n getRowTop: (rowIdx: number) => rowPositions[validateRowIdx(rowIdx)].top,\n getRowHeight: (rowIdx: number) => rowPositions[validateRowIdx(rowIdx)].height,\n findRowIdx(offset: number) {\n let start = 0;\n let end = rowPositions.length - 1;\n while (start <= end) {\n const middle = start + floor((end - start) / 2);\n const currentOffset = rowPositions[middle].top;\n\n if (currentOffset === offset) return middle;\n\n if (currentOffset < offset) {\n start = middle + 1;\n } else if (currentOffset > offset) {\n end = middle - 1;\n }\n\n if (start > end) return end;\n }\n return 0;\n }\n };\n }, [isGroupRow, rowHeight, rows]);\n\n if (!enableVirtualization) {\n return {\n rowOverscanStartIdx: 0,\n rowOverscanEndIdx: rows.length - 1,\n rows,\n rowsCount,\n totalRowHeight,\n isGroupRow,\n getRowTop,\n getRowHeight,\n findRowIdx\n };\n }\n\n const overscanThreshold = 4;\n const rowVisibleStartIdx = findRowIdx(scrollTop);\n const rowVisibleEndIdx = min(rows.length - 1, findRowIdx(scrollTop + clientHeight));\n const rowOverscanStartIdx = max(\n 0,\n floor((rowVisibleStartIdx - overscanThreshold) / RENDER_BATCH_SIZE) * RENDER_BATCH_SIZE\n );\n const rowOverscanEndIdx = min(\n rows.length - 1,\n ceil((rowVisibleEndIdx + overscanThreshold) / RENDER_BATCH_SIZE) * RENDER_BATCH_SIZE\n );\n\n return {\n rowOverscanStartIdx,\n rowOverscanEndIdx,\n rows,\n rowsCount,\n totalRowHeight,\n isGroupRow,\n getRowTop,\n getRowHeight,\n findRowIdx\n };\n}\n","import { css } from '@linaria/core';\nimport type { HeaderRendererProps } from '../types';\nconst headerSortCell = css`\n cursor: pointer;\n display: flex;\n`;\n\nconst headerSortCellClassname = `rdg-header-sort-cell ${headerSortCell}`;\n\nconst headerSortName = css`\n flex-grow: 1;\n overflow: hidden;\n overflow: clip;\n text-overflow: ellipsis;\n`;\n\nconst headerSortNameClassname = `rdg-header-sort-name ${headerSortName}`;\n\ntype SharedHeaderCellProps<R, SR> = Pick<\n HeaderRendererProps<R, SR>,\n 'sortDirection' | 'onSort' | 'priority'\n>;\ninterface Props<R, SR> extends SharedHeaderCellProps<R, SR> {\n children: React.ReactNode;\n}\n\nexport default function SortableHeaderCell<R, SR>({\n onSort,\n sortDirection,\n priority,\n children\n}: Props<R, SR>) {\n let sortText = '';\n if (sortDirection === 'ASC') {\n sortText = '\\u25B2';\n } else if (sortDirection === 'DESC') {\n sortText = '\\u25BC';\n }\n\n return (\n <span className={headerSortCellClassname} onClick={(e) => onSort(e.ctrlKey)}>\n <span className={headerSortNameClassname}>{children}</span>\n <span>\n {sortText}\n {priority}\n </span>\n </span>\n );\n}\n","import { css } from '@linaria/core';\n\nimport type { CalculatedColumn, SortColumn } from './types';\nimport type { HeaderRowProps } from './HeaderRow';\nimport SortableHeaderCell from './headerCells/SortableHeaderCell';\nimport { getCellStyle, getCellClassname } from './utils';\n\nconst cellResizable = css`\n &::after {\n content: '';\n cursor: col-resize;\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n width: 10px;\n }\n`;\n\nconst cellResizableClassname = `rdg-cell-resizable ${cellResizable}`;\n\ntype SharedHeaderRowProps<R, SR> = Pick<\n HeaderRowProps<R, SR, React.Key>,\n 'onSortColumnsChange' | 'allRowsSelected' | 'sortColumns'\n>;\n\nexport interface HeaderCellProps<R, SR> extends SharedHeaderRowProps<R, SR> {\n column: CalculatedColumn<R, SR>;\n colSpan: number | undefined;\n onResize: (column: CalculatedColumn<R, SR>, width: number) => void;\n onAllRowsSelectionChange: (checked: boolean) => void;\n}\n\nexport default function HeaderCell<R, SR>({\n column,\n colSpan,\n onResize,\n allRowsSelected,\n onAllRowsSelectionChange,\n sortColumns,\n onSortColumnsChange\n}: HeaderCellProps<R, SR>) {\n function onPointerDown(event: React.PointerEvent<HTMLDivElement>) {\n if (event.pointerType === 'mouse' && event.buttons !== 1) {\n return;\n }\n\n const { currentTarget, pointerId } = event;\n const { right } = currentTarget.getBoundingClientRect();\n const offset = right - event.clientX;\n\n if (offset > 11) {\n // +1px to account for the border size\n return;\n }\n\n function onPointerMove(event: PointerEvent) {\n if (event.pointerId !== pointerId) return;\n if (event.pointerType === 'mouse' && event.buttons !== 1) {\n onPointerUp(event);\n return;\n }\n const width = event.clientX + offset - currentTarget.getBoundingClientRect().left;\n if (width > 0) {\n onResize(column, width);\n }\n }\n\n function onPointerUp(event: PointerEvent) {\n if (event.pointerId !== pointerId) return;\n window.removeEventListener('pointermove', onPointerMove);\n window.removeEventListener('pointerup', onPointerUp);\n }\n\n event.preventDefault();\n window.addEventListener('pointermove', onPointerMove);\n window.addEventListener('pointerup', onPointerUp);\n }\n const sortIndex = sortColumns?.findIndex((sort) => sort.columnKey === column.key);\n const sortColumn =\n sortIndex !== undefined && sortIndex > -1 ? sortColumns![sortIndex] : undefined;\n const sortDirection = sortColumn?.direction;\n const priority = sortColumn !== undefined && sortColumns!.length > 1 ? sortIndex! + 1 : undefined;\n const ariaSort =\n sortDirection && !priority ? (sortDirection === 'ASC' ? 'ascending' : 'descending') : undefined;\n\n const onSort = (ctrlClick: boolean) => {\n if (onSortColumnsChange == null) return;\n const { sortDescendingFirst } = column;\n if (sortColumn === undefined) {\n // not currently sorted\n const nextSort: SortColumn = {\n columnKey: column.key,\n direction: sortDescendingFirst ? 'DESC' : 'ASC'\n };\n onSortColumnsChange(sortColumns && ctrlClick ? [...sortColumns, nextSort] : [nextSort]);\n } else {\n let nextSortColumn: SortColumn | undefined;\n if (\n (sortDescendingFirst && sortDirection === 'DESC') ||\n (!sortDescendingFirst && sortDirection === 'ASC')\n ) {\n nextSortColumn = {\n columnKey: column.key,\n direction: sortDirection === 'ASC' ? 'DESC' : 'ASC'\n };\n }\n if (ctrlClick) {\n const nextSortColumns = [...sortColumns!];\n if (nextSortColumn) {\n // swap direction\n nextSortColumns[sortIndex!] = nextSortColumn;\n } else {\n // remove sort\n nextSortColumns.splice(sortIndex!, 1);\n }\n onSortColumnsChange(nextSortColumns);\n } else {\n onSortColumnsChange(nextSortColumn ? [nextSortColumn] : []);\n }\n }\n };\n\n function getCell() {\n if (column.headerRenderer) {\n return (\n <column.headerRenderer\n column={column}\n sortDirection={sortDirection}\n priority={priority}\n onSort={onSort}\n allRowsSelected={allRowsSelected}\n onAllRowsSelectionChange={onAllRowsSelectionChange}\n />\n );\n }\n\n if (column.sortable) {\n return (\n <SortableHeaderCell onSort={onSort} sortDirection={sortDirection} priority={priority}>\n {column.name}\n </SortableHeaderCell>\n );\n }\n\n return column.name;\n }\n\n const className = getCellClassname(column, column.headerCellClass, {\n [cellResizableClassname]: column.resizable\n });\n\n return (\n <div\n role=\"columnheader\"\n aria-colindex={column.idx + 1}\n aria-sort={ariaSort}\n aria-colspan={colSpan}\n className={className}\n style={getCellStyle(column, colSpan)}\n onPointerDown={column.resizable ? onPointerDown : undefined}\n >\n {getCell()}\n </div>\n );\n}\n","import { useCallback, memo } from 'react';\n\nimport HeaderCell from './HeaderCell';\nimport type { CalculatedColumn } from './types';\nimport { assertIsValidKeyGetter, getColSpan } from './utils';\nimport type { DataGridProps } from './DataGrid';\nimport { headerRowClassname } from './style';\n\ntype SharedDataGridProps<R, SR, K extends React.Key> = Pick<\n DataGridProps<R, SR, K>,\n 'rows' | 'onSelectedRowsChange' | 'rowKeyGetter' | 'sortColumns' | 'onSortColumnsChange'\n>;\n\nexport interface HeaderRowProps<R, SR, K extends React.Key> extends SharedDataGridProps<R, SR, K> {\n columns: readonly CalculatedColumn<R, SR>[];\n allRowsSelected: boolean;\n onColumnResize: (column: CalculatedColumn<R, SR>, width: number) => void;\n lastFrozenColumnIndex: number;\n}\n\nfunction HeaderRow<R, SR, K extends React.Key>({\n columns,\n rows,\n rowKeyGetter,\n onSelectedRowsChange,\n allRowsSelected,\n onColumnResize,\n sortColumns,\n onSortColumnsChange,\n lastFrozenColumnIndex\n}: HeaderRowProps<R, SR, K>) {\n const handleAllRowsSelectionChange = useCallback(\n (checked: boolean) => {\n if (!onSelectedRowsChange) return;\n\n assertIsValidKeyGetter<R, K>(rowKeyGetter);\n\n const newSelectedRows = new Set<K>(checked ? rows.map(rowKeyGetter) : undefined);\n onSelectedRowsChange(newSelectedRows);\n },\n [onSelectedRowsChange, rows, rowKeyGetter]\n );\n\n const cells = [];\n for (let index = 0; index < columns.length; index++) {\n const column = columns[index];\n const colSpan = getColSpan(column, lastFrozenColumnIndex, { type: 'HEADER' });\n if (colSpan !== undefined) {\n index += colSpan - 1;\n }\n\n cells.push(\n <HeaderCell<R, SR>\n key={column.key}\n column={column}\n colSpan={colSpan}\n onResize={onColumnResize}\n allRowsSelected={allRowsSelected}\n onAllRowsSelectionChange={handleAllRowsSelectionChange}\n onSortColumnsChange={onSortColumnsChange}\n sortColumns={sortColumns}\n />\n );\n }\n\n return (\n <div\n role=\"row\"\n aria-rowindex={1} // aria-rowindex is 1 based\n className={headerRowClassname}\n >\n {cells}\n </div>\n );\n}\n\nexport default memo(HeaderRow) as <R, SR, K extends React.Key>(\n props: HeaderRowProps<R, SR, K>\n) => JSX.Element;\n","import { forwardRef, memo } from 'react';\nimport type { RefAttributes } from 'react';\nimport { css } from '@linaria/core';\n\nimport { getCellStyle, getCellClassname, isCellEditable } from './utils';\nimport type { CellRendererProps } from './types';\n\nconst cellCopied = css`\n background-color: #ccccff;\n`;\n\nconst cellCopiedClassname = `rdg-cell-copied ${cellCopied}`;\n\nconst cellDraggedOver = css`\n background-color: #ccccff;\n\n &.${cellCopied} {\n background-color: #9999ff;\n }\n`;\n\nconst cellDraggedOverClassname = `rdg-cell-dragged-over ${cellDraggedOver}`;\n\nconst cellDragHandle = css`\n cursor: move;\n position: absolute;\n right: 0;\n bottom: 0;\n width: 8px;\n height: 8px;\n background-color: var(--selection-color);\n\n &:hover {\n width: 16px;\n height: 16px;\n border: 2px solid var(--selection-color);\n background-color: var(--background-color);\n }\n`;\n\nconst cellDragHandleClassname = `rdg-cell-drag-handle ${cellDragHandle}`;\n\nfunction Cell<R, SR>(\n {\n className,\n column,\n colSpan,\n isCellSelected,\n isCopied,\n isDraggedOver,\n row,\n rowIdx,\n dragHandleProps,\n onRowClick,\n onClick,\n onDoubleClick,\n onContextMenu,\n onRowChange,\n selectCell,\n ...props\n }: CellRendererProps<R, SR>,\n ref: React.Ref<HTMLDivElement>\n) {\n const { cellClass } = column;\n className = getCellClassname(\n column,\n {\n [cellCopiedClassname]: isCopied,\n [cellDraggedOverClassname]: isDraggedOver\n },\n typeof cellClass === 'function' ? cellClass(row) : cellClass,\n className\n );\n\n function selectCellWrapper(openEditor?: boolean | null) {\n selectCell({ idx: column.idx, rowIdx }, openEditor);\n }\n\n function handleClick(event: React.MouseEvent<HTMLDivElement>) {\n selectCellWrapper(column.editorOptions?.editOnClick);\n onRowClick?.(rowIdx, row, column);\n onClick?.(event);\n }\n\n function handleContextMenu(event: React.MouseEvent<HTMLDivElement>) {\n selectCellWrapper();\n onContextMenu?.(event);\n }\n\n function handleDoubleClick(event: React.MouseEvent<HTMLDivElement>) {\n selectCellWrapper(true);\n onDoubleClick?.(event);\n }\n\n function handleRowChange(newRow: R) {\n onRowChange(rowIdx, newRow);\n }\n\n return (\n <div\n role=\"gridcell\"\n aria-colindex={column.idx + 1} // aria-colindex is 1-based\n aria-selected={isCellSelected}\n aria-colspan={colSpan}\n aria-readonly={!isCellEditable(column, row) || undefined}\n ref={ref}\n className={className}\n style={getCellStyle(column, colSpan)}\n onClick={handleClick}\n onDoubleClick={handleDoubleClick}\n onContextMenu={handleContextMenu}\n {...props}\n >\n {!column.rowGroup && (\n <>\n <column.formatter\n column={column}\n rowIdx={rowIdx}\n row={row}\n isCellSelected={isCellSelected}\n onRowChange={handleRowChange}\n />\n {dragHandleProps && <div className={cellDragHandleClassname} {...dragHandleProps} />}\n </>\n )}\n </div>\n );\n}\n\nexport default memo(forwardRef(Cell)) as <R, SR>(\n props: CellRendererProps<R, SR> & RefAttributes<HTMLDivElement>\n) => JSX.Element;\n","import { useEffect, useRef } from 'react';\nimport { createPortal } from 'react-dom';\nimport { css } from '@linaria/core';\n\nimport { useLatestFunc } from './hooks';\nimport { getCellStyle, getCellClassname } from './utils';\nimport type { CellRendererProps, EditorProps } from './types';\n\n/*\n * To check for outside `mousedown` events, we listen to all `mousedown` events at their birth,\n * i.e. on the window during the capture phase, and at their death, i.e. on the window during the bubble phase.\n *\n * We schedule a check at the birth of the event, cancel the check when the event reaches the \"inside\" container,\n * and trigger the \"outside\" callback when the event bubbles back up to the window.\n *\n * The event can be `stopPropagation()`ed halfway through, so they may not always bubble back up to the window,\n * so an alternative check must be used. The check must happen after the event can reach the \"inside\" container,\n * and not before it run to completion. `requestAnimationFrame` is the best way we know how to achieve this.\n * Usually we want click event handlers from parent components to access the latest commited values,\n * so `mousedown` is used instead of `click`.\n *\n * We must also rely on React's event capturing/bubbling to handle elements rendered in a portal.\n */\n\nconst cellEditing = css`\n padding: 0;\n`;\n\nconst cellEditingClassname = `rdg-editor-container ${cellEditing}`;\n\ntype SharedCellRendererProps<R, SR> = Pick<CellRendererProps<R, SR>, 'colSpan'>;\n\ninterface EditCellProps<R, SR> extends EditorProps<R, SR>, SharedCellRendererProps<R, SR> {\n onKeyDown: Required<React.HTMLAttributes<HTMLDivElement>>['onKeyDown'];\n}\n\nexport default function EditCell<R, SR>({\n column,\n colSpan,\n row,\n rowIdx,\n onRowChange,\n onClose,\n onKeyDown,\n editorPortalTarget\n}: EditCellProps<R, SR>) {\n const frameRequestRef = useRef<number | undefined>();\n\n // We need to prevent the `useEffect` from cleaning up between re-renders,\n // as `onWindowCaptureMouseDown` might otherwise miss valid mousedown events.\n // To that end we instead access the latest props via useLatestFunc.\n const commitOnOutsideMouseDown = useLatestFunc(() => {\n onRowChange(row, true);\n });\n\n function cancelFrameRequest() {\n cancelAnimationFrame(frameRequestRef.current!);\n }\n\n useEffect(() => {\n function onWindowCaptureMouseDown() {\n frameRequestRef.current = requestAnimationFrame(commitOnOutsideMouseDown);\n }\n\n addEventListener('mousedown', onWindowCaptureMouseDown, { capture: true });\n\n return () => {\n removeEventListener('mousedown', onWindowCaptureMouseDown, { capture: true });\n cancelFrameRequest();\n };\n }, [commitOnOutsideMouseDown]);\n\n const { cellClass } = column;\n const className = getCellClassname(\n column,\n cellEditingClassname,\n typeof cellClass === 'function' ? cellClass(row) : cellClass\n );\n\n let content;\n if (column.editor != null) {\n content = (\n <column.editor\n column={column}\n row={row}\n rowIdx={rowIdx}\n onRowChange={onRowChange}\n onClose={onClose}\n editorPortalTarget={editorPortalTarget}\n />\n );\n\n if (column.editorOptions?.createPortal) {\n content = createPortal(content, editorPortalTarget);\n }\n }\n\n return (\n <div\n role=\"gridcell\"\n aria-colindex={column.idx + 1} // aria-colindex is 1-based\n aria-selected\n className={className}\n style={getCellStyle(column, colSpan)}\n onKeyDown={onKeyDown}\n onMouseDownCapture={cancelFrameRequest}\n >\n {content}\n </div>\n );\n}\n","import { memo, forwardRef } from 'react';\nimport type { RefAttributes, CSSProperties } from 'react';\nimport clsx from 'clsx';\n\nimport { groupRowSelectedClassname, rowClassname } from './style';\nimport { getColSpan } from './utils';\nimport Cell from './Cell';\nimport EditCell from './EditCell';\nimport type { RowRendererProps, SelectedCellProps } from './types';\nimport { RowSelectionProvider } from './hooks';\n\nfunction Row<R, SR>(\n {\n cellRenderer,\n className,\n rowIdx,\n isRowSelected,\n copiedCellIdx,\n draggedOverCellIdx,\n lastFrozenColumnIndex,\n row,\n viewportColumns,\n selectedCellProps,\n onRowClick,\n rowClass,\n setDraggedOverRowIdx,\n onMouseEnter,\n top,\n height,\n onRowChange,\n selectCell,\n ...props\n }: RowRendererProps<R, SR>,\n ref: React.Ref<HTMLDivElement>\n) {\n function handleDragEnter(event: React.MouseEvent<HTMLDivElement>) {\n setDraggedOverRowIdx?.(rowIdx);\n onMouseEnter?.(event);\n }\n\n className = clsx(\n rowClassname,\n `rdg-row-${rowIdx % 2 === 0 ? 'even' : 'odd'}`,\n {\n [groupRowSelectedClassname]: selectedCellProps?.idx === -1\n },\n rowClass?.(row),\n className\n );\n\n const CellRenderer = cellRenderer ?? Cell;\n const cells = [];\n\n for (let index = 0; index < viewportColumns.length; index++) {\n const column = viewportColumns[index];\n const colSpan = getColSpan(column, lastFrozenColumnIndex, { type: 'ROW', row });\n if (colSpan !== undefined) {\n index += colSpan - 1;\n }\n\n const isCellSelected = selectedCellProps?.idx === column.idx;\n if (selectedCellProps?.mode === 'EDIT' && isCellSelected) {\n cells.push(\n <EditCell\n key={column.key}\n rowIdx={rowIdx}\n column={column}\n colSpan={colSpan}\n onKeyDown={selectedCellProps.onKeyDown}\n {...selectedCellProps.editorProps}\n />\n );\n continue;\n }\n\n cells.push(\n <CellRenderer\n key={column.key}\n rowIdx={rowIdx}\n column={column}\n colSpan={colSpan}\n row={row}\n isCopied={copiedCellIdx === column.idx}\n isDraggedOver={draggedOverCellIdx === column.idx}\n isCellSelected={isCellSelected}\n dragHandleProps={\n isCellSelected ? (selectedCellProps as SelectedCellProps).dragHandleProps : undefined\n }\n onFocus={isCellSelected ? (selectedCellProps as SelectedCellProps).onFocus : undefined}\n onKeyDown={isCellSelected ? selectedCellProps!.onKeyDown : undefined}\n onRowClick={onRowClick}\n onRowChange={onRowChange}\n selectCell={selectCell}\n />\n );\n }\n\n return (\n <RowSelectionProvider value={isRowSelected}>\n <div\n role=\"row\"\n ref={ref}\n className={className}\n onMouseEnter={handleDragEnter}\n style={\n {\n top,\n '--row-height': `${height}px`\n } as unknown as CSSProperties\n }\n {...props}\n >\n {cells}\n </div>\n </RowSelectionProvider>\n );\n}\n\nexport default memo(forwardRef(Row)) as <R, SR>(\n props: RowRendererProps<R, SR> & RefAttributes<HTMLDivElement>\n) => JSX.Element;\n","import { memo } from 'react';\n\nimport { getCellStyle, getCellClassname } from './utils';\nimport type { CalculatedColumn } from './types';\nimport type { GroupRowRendererProps } from './GroupRow';\n\ntype SharedGroupRowRendererProps<R, SR> = Pick<\n GroupRowRendererProps<R, SR>,\n 'id' | 'rowIdx' | 'groupKey' | 'childRows' | 'isExpanded' | 'toggleGroup'\n>;\n\ninterface GroupCellProps<R, SR> extends SharedGroupRowRendererProps<R, SR> {\n column: CalculatedColumn<R, SR>;\n isCellSelected: boolean;\n groupColumnIndex: number;\n}\n\nfunction GroupCell<R, SR>({\n id,\n rowIdx,\n groupKey,\n childRows,\n isExpanded,\n isCellSelected,\n column,\n groupColumnIndex,\n toggleGroup: toggleGroupWrapper\n}: GroupCellProps<R, SR>) {\n function toggleGroup() {\n toggleGroupWrapper(id);\n }\n\n // Only make the cell clickable if the group level matches\n const isLevelMatching = column.rowGroup && groupColumnIndex === column.idx;\n\n return (\n <div\n role=\"gridcell\"\n aria-colindex={column.idx + 1}\n key={column.key}\n className={getCellClassname(column)}\n style={{\n ...getCellStyle(column),\n cursor: isLevelMatching ? 'pointer' : 'default'\n }}\n onClick={isLevelMatching ? toggleGroup : undefined}\n >\n {(!column.rowGroup || groupColumnIndex === column.idx) && column.groupFormatter && (\n <column.groupFormatter\n rowIdx={rowIdx}\n groupKey={groupKey}\n childRows={childRows}\n column={column}\n isExpanded={isExpanded}\n isCellSelected={isCellSelected}\n toggleGroup={toggleGroup}\n />\n )}\n </div>\n );\n}\n\nexport default memo(GroupCell) as <R, SR>(props: GroupCellProps<R, SR>) => JSX.Element;\n","import type { CSSProperties } from 'react';\nimport { memo } from 'react';\nimport clsx from 'clsx';\n\nimport { groupRowClassname, groupRowSelectedClassname, rowClassname } from './style';\nimport { SELECT_COLUMN_KEY } from './Columns';\nimport GroupCell from './GroupCell';\nimport type { CalculatedColumn, Position, Omit } from './types';\nimport { RowSelectionProvider } from './hooks';\n\nexport interface GroupRowRendererProps<R, SR>\n extends Omit<React.HTMLAttributes<HTMLDivElement>, 'style' | 'children'> {\n id: string;\n groupKey: unknown;\n viewportColumns: readonly CalculatedColumn<R, SR>[];\n childRows: readonly R[];\n rowIdx: number;\n top: number;\n height: number;\n level: number;\n selectedCellIdx: number | undefined;\n isExpanded: boolean;\n isRowSelected: boolean;\n selectCell: (position: Position, enableEditor?: boolean) => void;\n toggleGroup: (expandedGroupId: unknown) => void;\n}\n\nfunction GroupedRow<R, SR>({\n id,\n groupKey,\n viewportColumns,\n childRows,\n rowIdx,\n top,\n height,\n level,\n isExpanded,\n selectedCellIdx,\n isRowSelected,\n selectCell,\n toggleGroup,\n ...props\n}: GroupRowRendererProps<R, SR>) {\n // Select is always the first column\n const idx = viewportColumns[0].key === SELECT_COLUMN_KEY ? level + 1 : level;\n\n function selectGroup() {\n selectCell({ rowIdx, idx: -1 });\n }\n\n return (\n <RowSelectionProvider value={isRowSelected}>\n <div\n role=\"row\"\n aria-level={level}\n aria-expanded={isExpanded}\n className={clsx(\n rowClassname,\n groupRowClassname,\n `rdg-row-${rowIdx % 2 === 0 ? 'even' : 'odd'}`,\n {\n [groupRowSelectedClassname]: selectedCellIdx === -1 // Select row if there is no selected cell\n }\n )}\n onClick={selectGroup}\n style={\n {\n top,\n '--row-height': `${height}px`\n } as unknown as CSSProperties\n }\n {...props}\n >\n {viewportColumns.map((column) => (\n <GroupCell\n key={column.key}\n id={id}\n rowIdx={rowIdx}\n groupKey={groupKey}\n childRows={childRows}\n isExpanded={isExpanded}\n isCellSelected={selectedCellIdx === column.idx}\n column={column}\n groupColumnIndex={idx}\n toggleGroup={toggleGroup}\n />\n ))}\n </div>\n </RowSelectionProvider>\n );\n}\n\nexport default memo(GroupedRow) as <R, SR>(props: GroupRowRendererProps<R, SR>) => JSX.Element;\n","import { memo } from 'react';\n\nimport { getCellStyle, getCellClassname } from './utils';\nimport type { CellRendererProps } from './types';\n\ntype SharedCellRendererProps<R, SR> = Pick<CellRendererProps<R, SR>, 'column' | 'colSpan'>;\n\ninterface SummaryCellProps<R, SR> extends SharedCellRendererProps<R, SR> {\n row: SR;\n}\n\nfunction SummaryCell<R, SR>({ column, colSpan, row }: SummaryCellProps<R, SR>) {\n const { summaryFormatter: SummaryFormatter, summaryCellClass } = column;\n const className = getCellClassname(\n column,\n typeof summaryCellClass === 'function' ? summaryCellClass(row) : summaryCellClass\n );\n\n return (\n <div\n role=\"gridcell\"\n aria-colindex={column.idx + 1}\n aria-colspan={colSpan}\n className={className}\n style={getCellStyle(column, colSpan)}\n >\n {SummaryFormatter && <SummaryFormatter column={column} row={row} />}\n </div>\n );\n}\n\nexport default memo(SummaryCell) as <R, SR>(props: SummaryCellProps<R, SR>) => JSX.Element;\n","import { memo } from 'react';\nimport { rowClassname, summaryRowClassname } from './style';\nimport { getColSpan } from './utils';\nimport SummaryCell from './SummaryCell';\nimport type { RowRendererProps } from './types';\n\ntype SharedRowRendererProps<R, SR> = Pick<RowRendererProps<R, SR>, 'viewportColumns' | 'rowIdx'>;\n\ninterface SummaryRowProps<R, SR> extends SharedRowRendererProps<R, SR> {\n 'aria-rowindex': number;\n row: SR;\n bottom: number;\n lastFrozenColumnIndex: number;\n}\n\nfunction SummaryRow<R, SR>({\n rowIdx,\n row,\n viewportColumns,\n bottom,\n lastFrozenColumnIndex,\n 'aria-rowindex': ariaRowIndex\n}: SummaryRowProps<R, SR>) {\n const cells = [];\n for (let index = 0; index < viewportColumns.length; index++) {\n const column = viewportColumns[index];\n const colSpan = getColSpan(column, lastFrozenColumnIndex, { type: 'SUMMARY', row });\n if (colSpan !== undefined) {\n index += colSpan - 1;\n }\n\n cells.push(<SummaryCell<R, SR> key={column.key} column={column} colSpan={colSpan} row={row} />);\n }\n\n return (\n <div\n role=\"row\"\n aria-rowindex={ariaRowIndex}\n className={`${rowClassname} rdg-row-${\n rowIdx % 2 === 0 ? 'even' : 'odd'\n } ${summaryRowClassname}`}\n style={{ bottom }}\n >\n {cells}\n </div>\n );\n}\n\nexport default memo(SummaryRow) as <R, SR>(props: SummaryRowProps<R, SR>) => JSX.Element;\n","import {\n forwardRef,\n useState,\n useRef,\n useLayoutEffect,\n useImperativeHandle,\n useCallback,\n useMemo\n} from 'react';\nimport type { Key, RefAttributes } from 'react';\nimport clsx from 'clsx';\n\nimport { rootClassname, viewportDraggingClassname, focusSinkClassname } from './style';\nimport {\n useGridDimensions,\n useCalculatedColumns,\n useViewportColumns,\n useViewportRows,\n useLatestFunc,\n RowSelectionChangeProvider\n} from './hooks';\nimport HeaderRow from './HeaderRow';\nimport Row from './Row';\nimport GroupRowRenderer from './GroupRow';\nimport SummaryRow from './SummaryRow';\nimport {\n assertIsValidKeyGetter,\n onEditorNavigation,\n getNextSelectedCellPosition,\n isSelectedCellEditable,\n canExitGrid,\n isCtrlKeyHeldDown,\n isDefaultCellInput,\n getColSpan,\n max,\n sign\n} from './utils';\n\nimport type {\n CalculatedColumn,\n Column,\n Position,\n RowRendererProps,\n RowsChangeData,\n SelectRowEvent,\n SelectedCellProps,\n EditCellProps,\n FillEvent,\n PasteEvent,\n CellNavigationMode,\n SortColumn,\n RowHeightArgs,\n SelectCellFn\n} from './types';\n\ninterface SelectCellState extends Position {\n mode: 'SELECT';\n}\n\ninterface EditCellState<R> extends Position {\n mode: 'EDIT';\n row: R;\n originalRow: R;\n key: string | null;\n}\n\ntype DefaultColumnOptions<R, SR> = Pick<\n Column<R, SR>,\n 'formatter' | 'minWidth' | 'resizable' | 'sortable'\n>;\n\n// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\nconst body = globalThis.document?.body;\n\nconst initialPosition: SelectCellState = {\n idx: -1,\n rowIdx: -1,\n mode: 'SELECT'\n};\n\nexport interface DataGridHandle {\n element: HTMLDivElement | null;\n scrollToColumn: (colIdx: number) => void;\n scrollToRow: (rowIdx: number) => void;\n selectCell: SelectCellFn;\n}\n\ntype SharedDivProps = Pick<\n React.HTMLAttributes<HTMLDivElement>,\n 'aria-label' | 'aria-labelledby' | 'aria-describedby' | 'className' | 'style'\n>;\n\nexport interface DataGridProps<R, SR = unknown, K extends Key = Key> extends SharedDivProps {\n /**\n * Grid and data Props\n */\n /** An array of objects representing each column on the grid */\n columns: readonly Column<R, SR>[];\n /** A function called for each rendered row that should return a plain key/value pair object */\n rows: readonly R[];\n /**\n * Rows to be pinned at the bottom of the rows view for summary, the vertical scroll bar will not scroll these rows.\n * Bottom horizontal scroll bar can move the row left / right. Or a customized row renderer can be used to disabled the scrolling support.\n */\n summaryRows?: readonly SR[] | null;\n /** The getter should return a unique key for each row */\n rowKeyGetter?: ((row: R) => K) | null;\n onRowsChange?: ((rows: R[], data: RowsChangeData<R, SR>) => void) | null;\n\n /**\n * Dimensions props\n */\n /** The height of each row in pixels */\n rowHeight?: number | ((args: RowHeightArgs<R>) => number) | null;\n /** The height of the header row in pixels */\n headerRowHeight?: number | null;\n /** The height of each summary row in pixels */\n summaryRowHeight?: number | null;\n\n /**\n * Feature props\n */\n /** Set of selected row keys */\n selectedRows?: ReadonlySet<K> | null;\n /** Function called whenever row selection is changed */\n onSelectedRowsChange?: ((selectedRows: Set<K>) => void) | null;\n /**Used for multi column sorting */\n sortColumns?: readonly Readonly<SortColumn>[] | null;\n onSortColumnsChange?: ((sortColumns: SortColumn[]) => void) | null;\n defaultColumnOptions?: DefaultColumnOptions<R, SR> | null;\n groupBy?: readonly string[] | null;\n rowGrouper?: ((rows: readonly R[], columnKey: string) => Record<string, readonly R[]>) | null;\n expandedGroupIds?: ReadonlySet<unknown> | null;\n onExpandedGroupIdsChange?: ((expandedGroupIds: Set<unknown>) => void) | null;\n onFill?: ((event: FillEvent<R>) => R[]) | null;\n onPaste?: ((event: PasteEvent<R>) => R) | null;\n\n /**\n * Custom renderers\n */\n rowRenderer?: React.ComponentType<RowRendererProps<R, SR>> | null;\n emptyRowsRenderer?: React.ComponentType | null;\n\n /**\n * Event props\n */\n /** Function called whenever a row is clicked */\n onRowClick?: ((rowIdx: number, row: R, column: CalculatedColumn<R, SR>) => void) | null;\n /** Called when the grid is scrolled */\n onScroll?: ((event: React.UIEvent<HTMLDivElement>) => void) | null;\n /** Called when a column is resized */\n onColumnResize?: ((idx: number, width: number) => void) | null;\n /** Function called whenever selected cell is changed */\n onSelectedCellChange?: ((position: Position) => void) | null;\n\n /**\n * Toggles and modes\n */\n cellNavigationMode?: CellNavigationMode | null;\n enableVirtualization?: boolean | null;\n\n /**\n * Miscellaneous\n */\n /** The node where the editor portal should mount. */\n editorPortalTarget?: Element | null;\n rowClass?: ((row: R) => string | undefined | null) | null;\n}\n\n/**\n * Main API Component to render a data grid of rows and columns\n *\n * @example\n *\n * <DataGrid columns={columns} rows={rows} />\n */\nfunction DataGrid<R, SR, K extends Key>(\n {\n // Grid and data Props\n columns: rawColumns,\n rows: rawRows,\n summaryRows,\n rowKeyGetter,\n onRowsChange,\n // Dimensions props\n rowHeight,\n headerRowHeight: rawHeaderRowHeight,\n summaryRowHeight: rawSummaryRowHeight,\n // Feature props\n selectedRows,\n onSelectedRowsChange,\n sortColumns,\n onSortColumnsChange,\n defaultColumnOptions,\n groupBy: rawGroupBy,\n rowGrouper,\n expandedGroupIds,\n onExpandedGroupIdsChange,\n // Custom renderers\n rowRenderer,\n emptyRowsRenderer: EmptyRowsRenderer,\n // Event props\n onRowClick,\n onScroll,\n onColumnResize,\n onSelectedCellChange,\n onFill,\n onPaste,\n // Toggles and modes\n cellNavigationMode: rawCellNavigationMode,\n enableVirtualization,\n // Miscellaneous\n editorPortalTarget: rawEditorPortalTarget,\n className,\n style,\n rowClass,\n // ARIA\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n 'aria-describedby': ariaDescribedBy\n }: DataGridProps<R, SR, K>,\n ref: React.Ref<DataGridHandle>\n) {\n /**\n * defaults\n */\n rowHeight ??= 35;\n const headerRowHeight = rawHeaderRowHeight ?? (typeof rowHeight === 'number' ? rowHeight : 35);\n const summaryRowHeight = rawSummaryRowHeight ?? (typeof rowHeight === 'number' ? rowHeight : 35);\n const RowRenderer = rowRenderer ?? Row;\n const cellNavigationMode = rawCellNavigationMode ?? 'NONE';\n enableVirtualization ??= true;\n const editorPortalTarget = rawEditorPortalTarget ?? body;\n\n /**\n * states\n */\n const [scrollTop, setScrollTop] = useState(0);\n const [scrollLeft, setScrollLeft] = useState(0);\n const [columnWidths, setColumnWidths] = useState<ReadonlyMap<string, number>>(() => new Map());\n const [selectedPosition, setSelectedPosition] =\n useState<SelectCellState | EditCellState<R>>(initialPosition);\n const [copiedCell, setCopiedCell] = useState<{ row: R; columnKey: string } | null>(null);\n const [isDragging, setDragging] = useState(false);\n const [draggedOverRowIdx, setOverRowIdx] = useState<number | undefined>(undefined);\n\n /**\n * refs\n */\n const focusSinkRef = useRef<HTMLDivElement>(null);\n const prevSelectedPosition = useRef(selectedPosition);\n const latestDraggedOverRowIdx = useRef(draggedOverRowIdx);\n const lastSelectedRowIdx = useRef(-1);\n const isCellFocusable = useRef(false);\n\n /**\n * The identity of the wrapper function is stable so it won't break memoization\n */\n const selectRowWrapper = useLatestFunc(selectRow);\n const selectCellWrapper = useLatestFunc(selectCell);\n const toggleGroupWrapper = useLatestFunc(toggleGroup);\n const handleFormatterRowChangeWrapper = useLatestFunc(updateRow);\n\n /**\n * computed values\n */\n const [gridRef, gridWidth, gridHeight] = useGridDimensions();\n const headerRowsCount = 1;\n const summaryRowsCount = summaryRows?.length ?? 0;\n const clientHeight = gridHeight - headerRowHeight - summaryRowsCount * summaryRowHeight;\n const isSelectable = selectedRows != null && onSelectedRowsChange != null;\n\n const allRowsSelected = useMemo((): boolean => {\n // no rows to select = explicitely unchecked\n const { length } = rawRows;\n return (\n length !== 0 &&\n selectedRows != null &&\n rowKeyGetter != null &&\n selectedRows.size >= length &&\n rawRows.every((row) => selectedRows.has(rowKeyGetter(row)))\n );\n }, [rawRows, selectedRows, rowKeyGetter]);\n\n const {\n columns,\n colSpanColumns,\n colOverscanStartIdx,\n colOverscanEndIdx,\n layoutCssVars,\n columnMetrics,\n totalColumnWidth,\n lastFrozenColumnIndex,\n totalFrozenColumnWidth,\n groupBy\n } = useCalculatedColumns({\n rawColumns,\n columnWidths,\n scrollLeft,\n viewportWidth: gridWidth,\n defaultColumnOptions,\n rawGroupBy: rowGrouper ? rawGroupBy : undefined,\n enableVirtualization\n });\n\n const {\n rowOverscanStartIdx,\n rowOverscanEndIdx,\n rows,\n rowsCount,\n totalRowHeight,\n isGroupRow,\n getRowTop,\n getRowHeight,\n findRowIdx\n } = useViewportRows({\n rawRows,\n groupBy,\n rowGrouper,\n rowHeight,\n clientHeight,\n scrollTop,\n expandedGroupIds,\n enableVirtualization\n });\n\n const viewportColumns = useViewportColumns({\n columns,\n colSpanColumns,\n colOverscanStartIdx,\n colOverscanEndIdx,\n lastFrozenColumnIndex,\n rowOverscanStartIdx,\n rowOverscanEndIdx,\n rows,\n summaryRows,\n isGroupRow\n });\n\n const hasGroups = groupBy.length > 0 && typeof rowGrouper === 'function';\n const minColIdx = hasGroups ? -1 : 0;\n\n // Cell drag is not supported on a treegrid\n const enableCellDragAndDrop = hasGroups ? false : onFill != null;\n\n /**\n * effects\n */\n useLayoutEffect(() => {\n if (\n selectedPosition === prevSelectedPosition.current ||\n selectedPosition.mode === 'EDIT' ||\n !isCellWithinBounds(selectedPosition)\n ) {\n return;\n }\n prevSelectedPosition.current = selectedPosition;\n scrollToCell(selectedPosition);\n\n if (isCellFocusable.current) {\n isCellFocusable.current = false;\n return;\n }\n focusSinkRef.current!.focus({ preventScroll: true });\n });\n\n useImperativeHandle(ref, () => ({\n element: gridRef.current,\n scrollToColumn(idx: number) {\n scrollToCell({ idx });\n },\n scrollToRow(rowIdx: number) {\n const { current } = gridRef;\n if (!current) return;\n current.scrollTo({\n top: getRowTop(rowIdx),\n behavior: 'smooth'\n });\n },\n selectCell\n }));\n\n /**\n * callbacks\n */\n const handleColumnResize = useCallback(\n (column: CalculatedColumn<R, SR>, width: number) => {\n setColumnWidths((columnWidths) => {\n const newColumnWidths = new Map(columnWidths);\n newColumnWidths.set(column.key, width);\n return newColumnWidths;\n });\n\n onColumnResize?.(column.idx, width);\n },\n [onColumnResize]\n );\n\n const setDraggedOverRowIdx = useCallback((rowIdx?: number) => {\n setOverRowIdx(rowIdx);\n latestDraggedOverRowIdx.current = rowIdx;\n }, []);\n\n /**\n * event handlers\n */\n function selectRow({ rowIdx, checked, isShiftClick }: SelectRowEvent) {\n if (!onSelectedRowsChange) return;\n\n assertIsValidKeyGetter<R, K>(rowKeyGetter);\n const newSelectedRows = new Set(selectedRows);\n const row = rows[rowIdx];\n if (isGroupRow(row)) {\n for (const childRow of row.childRows) {\n const rowKey = rowKeyGetter(childRow);\n if (checked) {\n newSelectedRows.add(rowKey);\n } else {\n newSelectedRows.delete(rowKey);\n }\n }\n onSelectedRowsChange(newSelectedRows);\n return;\n }\n\n const rowKey = rowKeyGetter(row);\n if (checked) {\n newSelectedRows.add(rowKey);\n const previousRowIdx = lastSelectedRowIdx.current;\n lastSelectedRowIdx.current = rowIdx;\n if (isShiftClick && previousRowIdx !== -1 && previousRowIdx !== rowIdx) {\n const step = sign(rowIdx - previousRowIdx);\n for (let i = previousRowIdx + step; i !== rowIdx; i += step) {\n const row = rows[i];\n if (isGroupRow(row)) continue;\n newSelectedRows.add(rowKeyGetter(row));\n }\n }\n } else {\n newSelectedRows.delete(rowKey);\n lastSelectedRowIdx.current = -1;\n }\n\n onSelectedRowsChange(newSelectedRows);\n }\n\n function toggleGroup(expandedGroupId: unknown) {\n if (!onExpandedGroupIdsChange) return;\n const newExpandedGroupIds = new Set(expandedGroupIds);\n if (newExpandedGroupIds.has(expandedGroupId)) {\n newExpandedGroupIds.delete(expandedGroupId);\n } else {\n newExpandedGroupIds.add(expandedGroupId);\n }\n onExpandedGroupIdsChange(newExpandedGroupIds);\n }\n\n function onGridFocus() {\n if (!isCellWithinBounds(selectedPosition)) {\n // Tabbing into the grid should initiate keyboard navigation\n const initialPosition: SelectCellState = { idx: 0, rowIdx: 0, mode: 'SELECT' };\n if (isCellWithinBounds(initialPosition)) {\n setSelectedPosition(initialPosition);\n }\n } else {\n // otherwise if we already have a selected cell, we should scroll back to it when focusing the grid\n scrollToCell(selectedPosition);\n }\n }\n\n function handleKeyDown(event: React.KeyboardEvent<HTMLDivElement>) {\n const { key, keyCode } = event;\n const row = rows[selectedPosition.rowIdx];\n\n if (\n onPaste &&\n isCtrlKeyHeldDown(event) &&\n isCellWithinBounds(selectedPosition) &&\n !isGroupRow(row) &&\n selectedPosition.idx !== -1 &&\n selectedPosition.mode === 'SELECT'\n ) {\n // event.key may differ by keyboard input language, so we use event.keyCode instead\n // event.nativeEvent.code cannot be used either as it would break copy/paste for the DVORAK layout\n const cKey = 67;\n const vKey = 86;\n if (keyCode === cKey) {\n handleCopy();\n return;\n }\n if (keyCode === vKey) {\n handlePaste();\n return;\n }\n }\n\n if (\n isCellWithinBounds(selectedPosition) &&\n isGroupRow(row) &&\n selectedPosition.idx === -1 &&\n // Collapse the current group row if it is focused and is in expanded state\n ((key === 'ArrowLeft' && row.isExpanded) ||\n // Expand the current group row if it is focused and is in collapsed state\n (key === 'ArrowRight' && !row.isExpanded))\n ) {\n event.preventDefault(); // Prevents scrolling\n toggleGroup(row.id);\n return;\n }\n\n switch (event.key) {\n case 'Escape':\n setCopiedCell(null);\n closeEditor();\n return;\n case 'ArrowUp':\n case 'ArrowDown':\n case 'ArrowLeft':\n case 'ArrowRight':\n case 'Tab':\n case 'Home':\n case 'End':\n case 'PageUp':\n case 'PageDown':\n navigate(event);\n break;\n default:\n handleCellInput(event);\n break;\n }\n }\n\n function handleFocus() {\n isCellFocusable.current = true;\n }\n\n function handleScroll(event: React.UIEvent<HTMLDivElement>) {\n const { scrollTop, scrollLeft } = event.currentTarget;\n setScrollTop(scrollTop);\n setScrollLeft(scrollLeft);\n onScroll?.(event);\n }\n\n function getRawRowIdx(rowIdx: number) {\n return hasGroups ? rawRows.indexOf(rows[rowIdx] as R) : rowIdx;\n }\n\n function updateRow(rowIdx: number, row: R) {\n if (typeof onRowsChange !== 'function') return;\n if (row === rawRows[rowIdx]) return;\n const updatedRows = [...rawRows];\n updatedRows[rowIdx] = row;\n onRowsChange(updatedRows, {\n indexes: [rowIdx],\n column: columns[selectedPosition.idx]\n });\n }\n\n function commitEditorChanges() {\n if (\n columns[selectedPosition.idx]?.editor == null ||\n selectedPosition.mode === 'SELECT' ||\n selectedPosition.row === selectedPosition.originalRow\n ) {\n return;\n }\n\n const rowIdx = getRawRowIdx(selectedPosition.rowIdx);\n updateRow(rowIdx, selectedPosition.row);\n }\n\n function handleCopy() {\n const { idx, rowIdx } = selectedPosition;\n setCopiedCell({ row: rawRows[getRawRowIdx(rowIdx)], columnKey: columns[idx].key });\n }\n\n function handlePaste() {\n const { idx, rowIdx } = selectedPosition;\n const targetRow = rawRows[getRawRowIdx(rowIdx)];\n if (!onPaste || !onRowsChange || copiedCell === null || !isCellEditable(selectedPosition)) {\n return;\n }\n\n const updatedTargetRow = onPaste({\n sourceRow: copiedCell.row,\n sourceColumnKey: copiedCell.columnKey,\n targetRow,\n targetColumnKey: columns[idx].key\n });\n\n updateRow(rowIdx, updatedTargetRow);\n }\n\n function handleCellInput(event: React.KeyboardEvent<HTMLDivElement>) {\n if (!isCellWithinBounds(selectedPosition)) return;\n const row = rows[selectedPosition.rowIdx];\n if (isGroupRow(row)) return;\n const { key } = event;\n const column = columns[selectedPosition.idx];\n\n if (selectedPosition.mode === 'EDIT') {\n if (key === 'Enter') {\n // Custom editors can listen for the event and stop propagation to prevent commit\n commitEditorChanges();\n closeEditor();\n }\n return;\n }\n\n column.editorOptions?.onCellKeyDown?.(event);\n if (event.isDefaultPrevented()) return;\n\n if (isCellEditable(selectedPosition) && isDefaultCellInput(event)) {\n setSelectedPosition(({ idx, rowIdx }) => ({\n idx,\n rowIdx,\n key,\n mode: 'EDIT',\n row,\n originalRow: row\n }));\n }\n }\n\n function handleDragEnd() {\n const overRowIdx = latestDraggedOverRowIdx.current;\n if (overRowIdx === undefined || !onFill || !onRowsChange) return;\n\n const { idx, rowIdx } = selectedPosition;\n const sourceRow = rawRows[rowIdx];\n const startRowIndex = rowIdx < overRowIdx ? rowIdx + 1 : overRowIdx;\n const endRowIndex = rowIdx < overRowIdx ? overRowIdx + 1 : rowIdx;\n const targetRows = rawRows.slice(startRowIndex, endRowIndex);\n const column = columns[idx];\n const updatedTargetRows = onFill({ columnKey: column.key, sourceRow, targetRows });\n const updatedRows = [...rawRows];\n const indexes: number[] = [];\n\n for (let i = startRowIndex; i < endRowIndex; i++) {\n const targetRowIdx = i - startRowIndex;\n if (updatedRows[i] !== updatedTargetRows[targetRowIdx]) {\n updatedRows[i] = updatedTargetRows[targetRowIdx];\n indexes.push(i);\n }\n }\n\n if (indexes.length > 0) {\n onRowsChange(updatedRows, { indexes, column });\n }\n setDraggedOverRowIdx(undefined);\n }\n\n function handleMouseDown(event: React.MouseEvent<HTMLDivElement, MouseEvent>) {\n if (event.buttons !== 1) return;\n setDragging(true);\n window.addEventListener('mouseover', onMouseOver);\n window.addEventListener('mouseup', onMouseUp);\n\n function onMouseOver(event: MouseEvent) {\n // Trigger onMouseup in edge cases where we release the mouse button but `mouseup` isn't triggered,\n // for example when releasing the mouse button outside the iframe the grid is rendered in.\n // https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/buttons\n if (event.buttons !== 1) onMouseUp();\n }\n\n function onMouseUp() {\n window.removeEventListener('mouseover', onMouseOver);\n window.removeEventListener('mouseup', onMouseUp);\n setDragging(false);\n handleDragEnd();\n }\n }\n\n function handleDoubleClick(event: React.MouseEvent<HTMLDivElement>) {\n event.stopPropagation();\n if (!onFill || !onRowsChange) return;\n\n const { idx, rowIdx } = selectedPosition;\n const sourceRow = rawRows[rowIdx];\n const targetRows = rawRows.slice(rowIdx + 1);\n const column = columns[idx];\n const updatedTargetRows = onFill({ columnKey: column.key, sourceRow, targetRows });\n const updatedRows = [...rawRows];\n const indexes: number[] = [];\n\n for (let i = rowIdx + 1; i < updatedRows.length; i++) {\n const targetRowIdx = i - rowIdx - 1;\n if (updatedRows[i] !== updatedTargetRows[targetRowIdx]) {\n updatedRows[i] = updatedTargetRows[targetRowIdx];\n indexes.push(i);\n }\n }\n\n if (indexes.length > 0) {\n onRowsChange(updatedRows, { indexes, column });\n }\n }\n\n function handleEditorRowChange(row: Readonly<R>, commitChanges?: boolean) {\n if (selectedPosition.mode === 'SELECT') return;\n if (commitChanges) {\n updateRow(getRawRowIdx(selectedPosition.rowIdx), row);\n closeEditor();\n } else {\n setSelectedPosition((position) => ({ ...position, row }));\n }\n }\n\n function handleOnClose(commitChanges?: boolean) {\n if (commitChanges) {\n commitEditorChanges();\n }\n closeEditor();\n }\n\n /**\n * utils\n */\n function isCellWithinBounds({ idx, rowIdx }: Position): boolean {\n return rowIdx >= 0 && rowIdx < rows.length && idx >= minColIdx && idx < columns.length;\n }\n\n function isCellEditable(position: Position): boolean {\n return (\n isCellWithinBounds(position) &&\n isSelectedCellEditable({ columns, rows, selectedPosition: position, isGroupRow })\n );\n }\n\n function selectCell(position: Position, enableEditor?: boolean | null): void {\n if (!isCellWithinBounds(position)) return;\n commitEditorChanges();\n\n if (enableEditor && isCellEditable(position)) {\n const row = rows[position.rowIdx] as R;\n setSelectedPosition({ ...position, mode: 'EDIT', key: null, row, originalRow: row });\n } else {\n setSelectedPosition({ ...position, mode: 'SELECT' });\n }\n onSelectedCellChange?.({ ...position });\n }\n\n function closeEditor() {\n if (selectedPosition.mode === 'SELECT') return;\n setSelectedPosition(({ idx, rowIdx }) => ({ idx, rowIdx, mode: 'SELECT' }));\n }\n\n function scrollToCell({ idx, rowIdx }: Partial<Position>): void {\n const { current } = gridRef;\n if (!current) return;\n\n if (typeof idx === 'number' && idx > lastFrozenColumnIndex) {\n rowIdx ??= selectedPosition.rowIdx;\n if (!isCellWithinBounds({ rowIdx, idx })) return;\n const { clientWidth } = current;\n const column = columns[idx];\n const { left, width } = columnMetrics.get(column)!;\n let right = left + width;\n const row = rows[rowIdx];\n if (!isGroupRow(row)) {\n const colSpan = getColSpan(column, lastFrozenColumnIndex, { type: 'ROW', row });\n if (colSpan !== undefined) {\n const { left, width } = columnMetrics.get(columns[column.idx + colSpan - 1])!;\n right = left + width;\n }\n }\n\n const isCellAtLeftBoundary = left < scrollLeft + totalFrozenColumnWidth;\n const isCellAtRightBoundary = right > clientWidth + scrollLeft;\n if (isCellAtLeftBoundary) {\n current.scrollLeft = left - totalFrozenColumnWidth;\n } else if (isCellAtRightBoundary) {\n current.scrollLeft = right - clientWidth;\n }\n }\n\n if (typeof rowIdx === 'number') {\n const rowTop = getRowTop(rowIdx);\n const rowHeight = getRowHeight(rowIdx);\n if (rowTop < scrollTop) {\n // at top boundary, scroll to the row's top\n current.scrollTop = rowTop;\n } else if (rowTop + rowHeight > scrollTop + clientHeight) {\n // at bottom boundary, scroll the next row's top to the bottom of the viewport\n current.scrollTop = rowTop + rowHeight - clientHeight;\n }\n }\n }\n\n function getNextPosition(key: string, ctrlKey: boolean, shiftKey: boolean): Position {\n const { idx, rowIdx } = selectedPosition;\n const row = rows[rowIdx];\n const isRowSelected = isCellWithinBounds(selectedPosition) && idx === -1;\n\n // If a group row is focused, and it is collapsed, move to the parent group row (if there is one).\n if (\n key === 'ArrowLeft' &&\n isRowSelected &&\n isGroupRow(row) &&\n !row.isExpanded &&\n row.level !== 0\n ) {\n let parentRowIdx = -1;\n for (let i = selectedPosition.rowIdx - 1; i >= 0; i--) {\n const parentRow = rows[i];\n if (isGroupRow(parentRow) && parentRow.id === row.parentId) {\n parentRowIdx = i;\n break;\n }\n }\n if (parentRowIdx !== -1) {\n return { idx, rowIdx: parentRowIdx };\n }\n }\n\n switch (key) {\n case 'ArrowUp':\n return { idx, rowIdx: rowIdx - 1 };\n case 'ArrowDown':\n return { idx, rowIdx: rowIdx + 1 };\n case 'ArrowLeft':\n return { idx: idx - 1, rowIdx };\n case 'ArrowRight':\n return { idx: idx + 1, rowIdx };\n case 'Tab':\n if (selectedPosition.idx === -1 && selectedPosition.rowIdx === -1) {\n return shiftKey\n ? { idx: columns.length - 1, rowIdx: rows.length - 1 }\n : { idx: 0, rowIdx: 0 };\n }\n return { idx: idx + (shiftKey ? -1 : 1), rowIdx };\n case 'Home':\n // If row is selected then move focus to the first row\n if (isRowSelected) return { idx, rowIdx: 0 };\n return ctrlKey ? { idx: 0, rowIdx: 0 } : { idx: 0, rowIdx };\n case 'End':\n // If row is selected then move focus to the last row.\n if (isRowSelected) return { idx, rowIdx: rows.length - 1 };\n return ctrlKey\n ? { idx: columns.length - 1, rowIdx: rows.length - 1 }\n : { idx: columns.length - 1, rowIdx };\n case 'PageUp': {\n const nextRowY = getRowTop(rowIdx) + getRowHeight(rowIdx) - clientHeight;\n return { idx, rowIdx: nextRowY > 0 ? findRowIdx(nextRowY) : 0 };\n }\n case 'PageDown': {\n const nextRowY = getRowTop(rowIdx) + clientHeight;\n return { idx, rowIdx: nextRowY < totalRowHeight ? findRowIdx(nextRowY) : rows.length - 1 };\n }\n default:\n return selectedPosition;\n }\n }\n\n function navigate(event: React.KeyboardEvent<HTMLDivElement>) {\n if (selectedPosition.mode === 'EDIT') {\n const onNavigation =\n columns[selectedPosition.idx].editorOptions?.onNavigation ?? onEditorNavigation;\n if (!onNavigation(event)) return;\n }\n const { key, shiftKey } = event;\n let mode = cellNavigationMode;\n if (key === 'Tab') {\n // If we are in a position to leave the grid, stop editing but stay in that cell\n if (\n canExitGrid({\n shiftKey,\n cellNavigationMode,\n columns,\n rowsCount: rows.length,\n selectedPosition\n })\n ) {\n commitEditorChanges();\n // Allow focus to leave the grid so the next control in the tab order can be focused\n return;\n }\n\n mode = cellNavigationMode === 'NONE' ? 'CHANGE_ROW' : cellNavigationMode;\n }\n\n // Do not allow focus to leave\n event.preventDefault();\n\n const ctrlKey = isCtrlKeyHeldDown(event);\n const nextPosition = getNextSelectedCellPosition({\n columns,\n colSpanColumns,\n rows,\n lastFrozenColumnIndex,\n cellNavigationMode: mode,\n currentPosition: selectedPosition,\n nextPosition: getNextPosition(key, ctrlKey, shiftKey),\n isCellWithinBounds,\n isGroupRow\n });\n\n selectCell(nextPosition);\n }\n\n function getDraggedOverCellIdx(currentRowIdx: number): number | undefined {\n if (draggedOverRowIdx === undefined) return;\n const { rowIdx } = selectedPosition;\n\n const isDraggedOver =\n rowIdx < draggedOverRowIdx\n ? rowIdx < currentRowIdx && currentRowIdx <= draggedOverRowIdx\n : rowIdx > currentRowIdx && currentRowIdx >= draggedOverRowIdx;\n\n return isDraggedOver ? selectedPosition.idx : undefined;\n }\n\n function getSelectedCellProps(rowIdx: number): SelectedCellProps | EditCellProps<R> | undefined {\n if (selectedPosition.rowIdx !== rowIdx) return;\n\n if (selectedPosition.mode === 'EDIT') {\n return {\n mode: 'EDIT',\n idx: selectedPosition.idx,\n onKeyDown: handleKeyDown,\n editorProps: {\n editorPortalTarget,\n row: selectedPosition.row,\n onRowChange: handleEditorRowChange,\n onClose: handleOnClose\n }\n };\n }\n\n return {\n mode: 'SELECT',\n idx: selectedPosition.idx,\n onFocus: handleFocus,\n onKeyDown: handleKeyDown,\n dragHandleProps:\n enableCellDragAndDrop && isCellEditable(selectedPosition)\n ? { onMouseDown: handleMouseDown, onDoubleClick: handleDoubleClick }\n : undefined\n };\n }\n\n function getViewportRows() {\n const rowElements = [];\n let startRowIndex = 0;\n for (let rowIdx = rowOverscanStartIdx; rowIdx <= rowOverscanEndIdx; rowIdx++) {\n const row = rows[rowIdx];\n const top = getRowTop(rowIdx) + headerRowHeight;\n if (isGroupRow(row)) {\n ({ startRowIndex } = row);\n const isGroupRowSelected =\n isSelectable && row.childRows.every((cr) => selectedRows?.has(rowKeyGetter!(cr)));\n rowElements.push(\n <GroupRowRenderer\n aria-level={row.level + 1} // aria-level is 1-based\n aria-setsize={row.setSize}\n aria-posinset={row.posInSet + 1} // aria-posinset is 1-based\n aria-rowindex={headerRowsCount + startRowIndex + 1} // aria-rowindex is 1 based\n aria-selected={isSelectable ? isGroupRowSelected : undefined}\n key={row.id}\n id={row.id}\n groupKey={row.groupKey}\n viewportColumns={viewportColumns}\n childRows={row.childRows}\n rowIdx={rowIdx}\n top={top}\n height={getRowHeight(rowIdx)}\n level={row.level}\n isExpanded={row.isExpanded}\n selectedCellIdx={selectedPosition.rowIdx === rowIdx ? selectedPosition.idx : undefined}\n isRowSelected={isGroupRowSelected}\n onFocus={selectedPosition.rowIdx === rowIdx ? handleFocus : undefined}\n onKeyDown={selectedPosition.rowIdx === rowIdx ? handleKeyDown : undefined}\n selectCell={selectCellWrapper}\n toggleGroup={toggleGroupWrapper}\n />\n );\n continue;\n }\n\n startRowIndex++;\n let key;\n let isRowSelected = false;\n if (typeof rowKeyGetter === 'function') {\n key = rowKeyGetter(row);\n isRowSelected = selectedRows?.has(key) ?? false;\n } else {\n key = hasGroups ? startRowIndex : rowIdx;\n }\n\n rowElements.push(\n <RowRenderer\n aria-rowindex={headerRowsCount + (hasGroups ? startRowIndex : rowIdx) + 1} // aria-rowindex is 1 based\n aria-selected={isSelectable ? isRowSelected : undefined}\n key={key}\n rowIdx={rowIdx}\n row={row}\n viewportColumns={viewportColumns}\n isRowSelected={isRowSelected}\n onRowClick={onRowClick}\n rowClass={rowClass}\n top={top}\n height={getRowHeight(rowIdx)}\n copiedCellIdx={\n copiedCell !== null && copiedCell.row === row\n ? columns.findIndex((c) => c.key === copiedCell.columnKey)\n : undefined\n }\n draggedOverCellIdx={getDraggedOverCellIdx(rowIdx)}\n setDraggedOverRowIdx={isDragging ? setDraggedOverRowIdx : undefined}\n lastFrozenColumnIndex={lastFrozenColumnIndex}\n selectedCellProps={getSelectedCellProps(rowIdx)}\n onRowChange={handleFormatterRowChangeWrapper}\n selectCell={selectCellWrapper}\n />\n );\n }\n\n return rowElements;\n }\n\n // Reset the positions if the current values are no longer valid. This can happen if a column or row is removed\n if (selectedPosition.idx >= columns.length || selectedPosition.rowIdx >= rows.length) {\n setSelectedPosition(initialPosition);\n setDraggedOverRowIdx(undefined);\n }\n\n if (\n selectedPosition.mode === 'EDIT' &&\n rows[selectedPosition.rowIdx] !== selectedPosition.originalRow\n ) {\n // Discard changes if rows are updated from outside\n closeEditor();\n }\n\n return (\n <div\n role={hasGroups ? 'treegrid' : 'grid'}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n aria-describedby={ariaDescribedBy}\n aria-multiselectable={isSelectable ? true : undefined}\n aria-colcount={columns.length}\n aria-rowcount={headerRowsCount + rowsCount + summaryRowsCount}\n className={clsx(rootClassname, { [viewportDraggingClassname]: isDragging }, className)}\n style={\n {\n ...style,\n '--header-row-height': `${headerRowHeight}px`,\n '--row-width': `${totalColumnWidth}px`,\n '--summary-row-height': `${summaryRowHeight}px`,\n ...layoutCssVars\n } as unknown as React.CSSProperties\n }\n ref={gridRef}\n onScroll={handleScroll}\n >\n <HeaderRow\n rowKeyGetter={rowKeyGetter}\n rows={rawRows}\n columns={viewportColumns}\n onColumnResize={handleColumnResize}\n allRowsSelected={allRowsSelected}\n onSelectedRowsChange={onSelectedRowsChange}\n sortColumns={sortColumns}\n onSortColumnsChange={onSortColumnsChange}\n lastFrozenColumnIndex={lastFrozenColumnIndex}\n />\n {rows.length === 0 && EmptyRowsRenderer ? (\n <EmptyRowsRenderer />\n ) : (\n <>\n {/*\n Ideally the focus should be set on the selected cell\n (https://www.w3.org/TR/wai-aria-practices-1.2/#kbd_roving_tabindex)\n but there are a few issues with this approach\n - onKeyDown/useLayoutEffect on the cell is not fast enough and grid\n looses focus if tab is pressed repeatedly\n - All the cells are not rendered so it is possible the focused cell\n is not in the viewport and unmounted and in this case the grid\n does not have any focusable element\n\n This first issue can be solved by setting onKeyDown on the root element\n but for the second issue we need to render the selected cell along with\n the cells in the viewport. This adds complexity.\n\n To circumvent this issue we are using an extra div element which is\n positioned on the top/left corner of the viewport and it listens for the\n keyboard event and sets the selected cell's position.\n */}\n <div\n ref={focusSinkRef}\n tabIndex={0}\n className={focusSinkClassname}\n onKeyDown={handleKeyDown}\n onFocus={onGridFocus}\n />\n <div style={{ height: max(totalRowHeight, clientHeight) }} />\n <RowSelectionChangeProvider value={selectRowWrapper}>\n {getViewportRows()}\n </RowSelectionChangeProvider>\n {summaryRows?.map((row, rowIdx) => (\n <SummaryRow\n aria-rowindex={headerRowsCount + rowsCount + rowIdx + 1}\n key={rowIdx}\n rowIdx={rowIdx}\n row={row}\n bottom={summaryRowHeight * (summaryRows.length - 1 - rowIdx)}\n viewportColumns={viewportColumns}\n lastFrozenColumnIndex={lastFrozenColumnIndex}\n />\n ))}\n </>\n )}\n </div>\n );\n}\n\nexport default forwardRef(DataGrid) as <R, SR = unknown, K extends Key = Key>(\n props: DataGridProps<R, SR, K> & RefAttributes<DataGridHandle>\n) => JSX.Element;\n","import { Widget } from \"@hpcc-js/common\";\nimport * as React from \"react\";\n\nexport function useData(widget: Widget): [string[], Array<string | number>[]] {\n // eslint-disable-next-line react-hooks/exhaustive-deps\n const columns: string[] = React.useMemo(() => widget.columns(), [widget, widget.dataChecksum()]);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n const data: Array<string | number>[] = React.useMemo(() => widget.data(), [widget, widget.dataChecksum()]);\n\n return [columns, data];\n}\n\n","import * as React from \"react\";\nimport DataGrid, { Column, SelectColumn, SortColumn } from \"react-data-grid\";\nimport { format, timeFormat, timeParse } from \"@hpcc-js/common\";\nimport { useData } from \"./hooks\";\nimport type { Table } from \"./table\";\n\nexport type QuerySortItem = { attribute: string, descending: boolean };\nfunction copyAndSort<T>(items: T[], attribute: string, descending?: boolean): T[] {\n const key = attribute as keyof T;\n return [...items].sort((a: T, b: T) => {\n if (a[key] < b[key]) {\n return descending ? 1 : -1;\n } else if (a[key] > b[key]) {\n return descending ? -1 : 1;\n }\n return 0;\n });\n}\n\ninterface EmptyRowsRendererProps {\n message: string\n}\n\nconst EmptyRowsRenderer: React.FunctionComponent<EmptyRowsRendererProps> = ({\n message\n}) => {\n\n return <div style={{ textAlign: \"center\", gridColumn: \"1/-1\" }} >\n {message}\n </div>;\n};\n\ninterface ColumnEx<TRow, TSummaryRow = unknown> extends Column<TRow, TSummaryRow> {\n renderCell?: (props: any) => React.JSX.Element;\n __hpcc_pattern?: ReturnType<typeof timeParse>;\n __hpcc_format?: ReturnType<typeof format> | ReturnType<typeof timeFormat>;\n}\n\nexport interface ReactTableProps {\n table: Table;\n sort?: QuerySortItem,\n}\n\nexport const ReactTable: React.FunctionComponent<ReactTableProps> = ({\n table,\n sort\n}) => {\n const [columns, data] = useData(table);\n const multiSelect = table.multiSelect();\n const columnTypes = table.columnTypes();\n const columnPatterns = table.columnPatterns();\n const columnFormats = table.columnFormats();\n\n const [listColumns, setListColumns] = React.useState<ColumnEx<any[]>[]>([]);\n const [sortColumn, setSortColumn] = React.useState<SortColumn>();\n const [rows, setRows] = React.useState<any[]>([]);\n const [selectedRows, setSelectedRows] = React.useState<ReadonlySet<number>>(new Set());\n\n // Columns ---\n React.useEffect(() => {\n setListColumns([\n ...multiSelect ? [SelectColumn] : [],\n ...columns.map((column): ColumnEx<any[]> => {\n const type = columnTypes[column] ?? \"string\";\n let formatter;\n let __hpcc_pattern;\n let __hpcc_format;\n switch (type) {\n case \"time\":\n __hpcc_pattern = columnPatterns[column] !== undefined ? timeParse(columnPatterns[column]) : undefined;\n __hpcc_format = columnFormats[column] !== undefined ? timeFormat(columnFormats[column]) : undefined;\n break;\n case \"number\":\n formatter = (props) => {\n return <div style={{ textAlign: \"right\" }}>{props.row[props.column.key]}</div>;\n };\n // eslint-disable-next-line no-fallthrough\n default:\n __hpcc_format = columnFormats[column] !== undefined ? format(columnFormats[column]) : undefined;\n }\n return {\n key: column,\n name: column,\n resizable: true,\n sortable: true,\n minWidth: 80,\n renderCell: formatter,\n __hpcc_pattern,\n __hpcc_format\n };\n })\n ]);\n }, [columnFormats, columnPatterns, columnTypes, columns, multiSelect]);\n\n const onSortColumnsChange = React.useCallback((sortColumns: SortColumn[]) => {\n const futureSortColumn = sortColumns.slice(-1)[0];\n const sorted = futureSortColumn !== undefined;\n const isSortedDescending: boolean = futureSortColumn?.direction === \"DESC\";\n setSortColumn(futureSortColumn);\n setRows(copyAndSort(rows, sorted ? futureSortColumn.columnKey : \"key\", sorted ? isSortedDescending : false));\n }, [rows]);\n\n const rowKeyGetter = React.useCallback((row: any) => {\n return row.key;\n }, []);\n\n const onSelectedRowsChange = React.useCallback((selectedRows: Set<any>) => {\n setSelectedRows(selectedRows);\n }, []);\n\n const onCellClick = React.useCallback((row, column) => {\n table.onRowClickCallback(row, column.key);\n }, [table]);\n\n // Rows ---\n React.useEffect(() => {\n let items = data.map((row, index) => {\n const retVal = {\n key: index\n };\n listColumns.forEach((column, index) => {\n let val = row[index] as string;\n if (column.__hpcc_pattern && column.__hpcc_format) {\n val = column.__hpcc_format(column.__hpcc_pattern(val));\n } else if (column.__hpcc_pattern) {\n val = column.__hpcc_pattern(val).toString();\n } else if (column.__hpcc_format) {\n val = column.__hpcc_format(val as any);\n }\n retVal[column.key] = val;\n });\n return retVal;\n });\n if (sort?.attribute) {\n items = copyAndSort(items, sort.attribute, sort.descending);\n }\n setRows(items);\n }, [listColumns, data, sort]);\n\n return <DataGrid\n columns={listColumns}\n headerRowHeight={24}\n rows={rows}\n rowKeyGetter={rowKeyGetter}\n rowHeight={20}\n emptyRowsRenderer={() => <EmptyRowsRenderer message={table.noDataMessage()} />}\n className={table.darkMode() ? \"rdg-dark\" : \"rdg-light\"}\n sortColumns={sortColumn ? [sortColumn] : []}\n onSortColumnsChange={onSortColumnsChange}\n selectedRows={selectedRows}\n onSelectedRowsChange={multiSelect ? onSelectedRowsChange : undefined}\n onRowClick={multiSelect ? undefined : (rowIdx, row, column) => onCellClick(row, column)}\n aria-describedby={\"\"}\n aria-label={\"\"}\n aria-labelledby={\"\"}\n style={{ height: \"100%\" }}\n />;\n};\n\n","function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n","import * as React from \"react\";\nimport { HTMLWidget, publish } from \"@hpcc-js/common\";\nimport { render, unmountComponentAtNode } from \"react-dom\";\nimport { ReactTable } from \"./reactTable\";\n\nimport \"../src/table.css\";\n\nexport type ColumnType = \"boolean\" | \"number\" | \"string\" | \"time\";\n\nexport class Table extends HTMLWidget {\n\n protected _div;\n\n constructor() {\n super();\n }\n\n @publish(\"...empty...\", \"string\", \"No Data Message\")\n noDataMessage: publish<this, string>;\n @publish(false, \"boolean\", \"Dark Mode\")\n darkMode: publish<this, boolean>;\n @publish(false, \"boolean\", \"Multiple Selection\")\n multiSelect: publish<this, boolean>;\n @publish({}, \"object\", \"Column Types (\\\"boolean\\\" | \\\"number\\\" | \\\"string\\\" | \\\"time\\\"\")\n columnTypes: publish<this, { [column: string]: ColumnType }>;\n @publish({}, \"object\", \"Column Patterns\")\n columnPatterns: publish<this, { [column: string]: string }>;\n @publish({}, \"object\", \"Column Formats\")\n columnFormats: publish<this, { [column: string]: string }>;\n\n columnType(column: string): ColumnType;\n columnType(column: string, type: ColumnType): this;\n columnType(column: string, type?: ColumnType): ColumnType | this {\n if (arguments.length === 1) return this.columnTypes()[column];\n this.columnTypes({ ...this.columnTypes(), [column]: type });\n return this;\n }\n\n columnPattern(column: string): string;\n columnPattern(column: string, pattern: string): this;\n columnPattern(column: string, pattern?: string): string | this {\n if (arguments.length === 1) return this.columnPatterns()[column];\n this.columnPatterns({ ...this.columnPatterns(), [column]: pattern });\n return this;\n }\n\n columnFormat(column: string): string;\n columnFormat(column: string, format: string): this;\n columnFormat(column: string, format?: string): string | this {\n if (arguments.length === 1) return this.columnFormats()[column];\n this.columnFormats({ ...this.columnFormats(), [column]: format });\n return this;\n }\n\n private _prevRow;\n private _prevColumn;\n onRowClickCallback(row, column) {\n if (this._prevRow && JSON.stringify(this._prevRow) !== JSON.stringify(row)) {\n this.click(this._prevRow, this._prevColumn ?? \"\", false);\n }\n if (row) {\n this.click(row, column, true);\n }\n this._prevRow = row;\n this._prevColumn = column;\n }\n\n enter(domNode, element) {\n super.enter(domNode, element);\n this._div = element\n .append(\"div\")\n ;\n }\n\n update(domNode, element) {\n super.update(domNode, element);\n this._div.style(\"width\", this.width() + \"px\");\n this._div.style(\"height\", this.height() + \"px\");\n render(React.createElement(ReactTable, { table: this }), this._div.node());\n }\n\n exit(domNode, element) {\n unmountComponentAtNode(this._div.node());\n this._div.remove();\n super.exit(domNode, element);\n }\n\n // Events ---\n click(row, col, sel) {\n }\n}\nTable.prototype._class += \" dgrid2_Table\";\n"],"names":["slice","options","vnodeId","rerenderQueue","prevDebounce","defer","depthSort","CAPTURE_REGEX","eventClock","eventProxy","eventProxyCapture","i","EMPTY_OBJ","EMPTY_ARR","IS_NON_DIMENSIONAL","isArray","Array","assign","obj","props","removeNode","node","parentNode","removeChild","createElement","type","children","key","ref","normalizedProps","arguments","length","call","defaultProps","undefined","createVNode","original","vnode","__k","__","__b","__e","__c","constructor","__v","__i","__u","Fragment","BaseComponent","context","this","getDomSibling","childIndex","sibling","updateParentDomPointers","child","base","enqueueRender","c","__d","push","process","__r","debounceRendering","component","newVNode","oldVNode","oldDom","commitQueue","refQueue","l","sort","shift","__P","diff","__n","namespaceURI","commitRoot","diffChildren","parentDom","renderResult","newParentVNode","oldParentVNode","globalContext","namespace","excessDomChildren","isHydrating","childVNode","newDom","firstChildDom","result","shouldPlace","oldChildren","newChildrenLength","constructNewChildrenArray","applyRef","insert","nextSibling","skewedIndex","matchingIndex","oldChildrenLength","remainingOldChildren","skew","String","findMatchingIndex","unmount","parentVNode","insertBefore","nodeType","toChildArray","out","some","x","y","matched","setStyle","style","value","setProperty","test","dom","name","oldValue","useCapture","lowerCaseName","o","cssText","replace","toLowerCase","_attached","addEventListener","removeEventListener","e","removeAttribute","setAttribute","createEventProxy","eventHandler","_dispatched","event","tmp","isNew","oldProps","oldState","snapshot","clearProcessingException","newProps","isClassComponent","provider","componentContext","renderHook","count","newType","outer","prototype","render","contextType","__E","doRender","sub","state","__h","_sb","__s","getDerivedStateFromProps","componentWillMount","componentDidMount","componentWillReceiveProps","shouldComponentUpdate","componentWillUpdate","componentDidUpdate","getChildContext","getSnapshotBeforeUpdate","cloneNode","then","MODE_HYDRATE","indexOf","markAsForce","diffElementNodes","diffed","forEach","root","cb","map","newHtml","oldHtml","newChildren","inputValue","checked","localName","document","createTextNode","createElementNS","is","__m","data","childNodes","attributes","__html","innerHTML","content","hasRefUnmount","current","skipRemove","r","componentWillUnmount","replaceNode","documentElement","firstChild","createContext","defaultValue","Context","subs","ctx","Set","_props","add","old","delete","Provider","__l","Consumer","contextValue","error","errorInfo","ctor","handled","getDerivedStateFromError","setState","componentDidCatch","update","callback","s","forceUpdate","Promise","bind","resolve","setTimeout","a","b","currentIndex","currentComponent","previousComponent","prevRaf","currentHook","afterPaintEffects","_options","oldBeforeDiff","oldBeforeRender","oldAfterDiff","oldCommit","oldBeforeUnmount","oldRoot","getHookState","index","hooks","__H","useState","initialState","useReducer","invokeOrReturn","reducer","init","hookState","_reducer","action","currentValue","__N","nextValue","__f","updateHookState","p","stateHooks","filter","every","prevScu","shouldUpdate","hookItem","prevCWU","useEffect","args","argsChanged","_pendingArgs","useLayoutEffect","useRef","initialValue","useMemo","useImperativeHandle","createHandle","concat","factory","useCallback","useContext","flushAfterPaintEffects","invokeCleanup","invokeEffect","requestAnimationFrame","afterNextFrame","hasErrored","HAS_RAF","raf","done","clearTimeout","timeout","cancelAnimationFrame","hook","comp","cleanup","oldArgs","newArgs","arg","f","shallowDiffers","PureComponent","memo","comparer","nextProps","updateRef","Memoed","displayName","isReactComponent","Component","isPureReactComponent","oldDiffHook","REACT_FORWARD_SYMBOL","Symbol","for","forwardRef","fn","Forwarded","clone","$$typeof","oldCatchError","oldUnmount","detachedClone","detachedParent","effect","removeOriginal","originalParent","appendChild","Suspense","_suspenders","suspended","__a","SuspenseList","_next","_map","__z","__R","promise","suspendingVNode","suspendingComponent","resolved","onResolved","onSuspensionComplete","originalParentDom","suspendedVNode","__O","pop","detachedComponent","fallback","list","revealOrder","size","ContextProvider","Portal","_this","container","_container","_temp","contains","before","splice","createPortal","el","containerInfo","delegated","get","unsuspend","wrappedUnsuspend","Map","reverse","set","REACT_ELEMENT_TYPE","CAMEL_PROPS","ON_ANI","CAMEL_REPLACE","IS_DOM","onChangeInputType","parent","textContent","preactRender","Object","defineProperty","configurable","v","writable","oldEventHook","empty","isPropagationStopped","cancelBubble","isDefaultPrevented","defaultPrevented","persist","nativeEvent","classNameDescriptorNonEnumberable","enumerable","class","oldVNodeHook","isNonDashedType","lowerCased","multiple","selected","className","handleDomVNode","oldDiffed","unmountComponentAtNode","isStaticChildren","__source","__self","styleInject","cell","cellClassname","cellFrozen","cellFrozenClassname","cellFrozenLast","cellFrozenLastClassname","rootClassname","focusSink","focusSinkClassname","viewportDragging","viewportDraggingClassname","groupRow","groupRowClassname","groupRowSelected","groupRowSelectedClassname","headerRow","headerRowClassname","row","rowClassname","summaryRow","summaryRowClassname","useFocusRef","isCellSelected","focus","preventScroll","checkboxLabel","checkboxLabelClassname","checkboxInput","checkboxInputClassname","checkbox","checkboxClassname","checkboxLabelDisabled","checkboxLabelDisabledClassname","SelectCellFormatter","tabIndex","disabled","onClick","onChange","ariaLabel","ariaLabelledBy","inputRef","handleChange","target","shiftKey","_jsxs","clsx","_jsx","ValueFormatter","column","groupCellContent","groupCellContentClassname","caret","caretClassname","ToggleGroupFormatter","groupKey","isExpanded","toggleGroup","cellRef","handleKeyDown","d","getColSpan","lastFrozenColumnIndex","colSpan","Number","isInteger","frozen","idx","stopPropagation","nonInputKeys","isCtrlKeyHeldDown","ctrlKey","metaKey","isDefaultCellInput","has","onEditorNavigation","HTMLInputElement","HTMLTextAreaElement","HTMLSelectElement","matches","isSelectedCellEditable","selectedPosition","columns","rows","isGroupRow","rowIdx","isCellEditable","editor","rowGroup","editable","getNextSelectedCellPosition","cellNavigationMode","colSpanColumns","currentPosition","nextPosition","isCellWithinBounds","rowsCount","position","setColSpan","moveRight","posIdx","colIdx","columnsCount","isAfterLastColumn","isBeforeFirstColumn","isLastRow","isFirstRow","canExitGrid","atLastCellInRow","atFirstCellInRow","atLastRow","atFirstRow","min","max","floor","ceil","sign","Math","assertIsValidKeyGetter","keyGetter","Error","getCellStyle","gridColumnStart","gridColumnEnd","left","getCellClassname","extraClasses","isLastFrozenColumn","SELECT_COLUMN_KEY","SelectFormatter","isRowSelected","onRowSelectionChange","useRowSelection","isShiftClick","SelectGroupFormatter","SelectColumn","width","maxWidth","resizable","sortable","headerRenderer","allRowsSelected","onAllRowsSelectionChange","formatter","groupFormatter","useCalculatedColumns","rawColumns","columnWidths","viewportWidth","scrollLeft","defaultColumnOptions","rawGroupBy","enableVirtualization","minColumnWidth","minWidth","defaultFormatter","defaultSortable","defaultResizable","groupBy","rawColumn","includes","aKey","frozenA","bKey","frozenB","layoutCssVars","totalColumnWidth","totalFrozenColumnWidth","columnMetrics","templateColumns","allocatedWidth","unassignedColumnsCount","getSpecifiedWidth","clampColumnWidth","unallocatedWidth","unallocatedColumnWidth","columnMetric","colOverscanStartIdx","colOverscanEndIdx","viewportLeft","viewportRight","lastColIdx","firstUnfrozenColumnIdx","colVisibleStartIdx","colVisibleEndIdx","parseInt","useGridDimensions","gridRef","gridWidth","setGridWidth","gridHeight","setGridHeight","ResizeObserver","window","resizeObserver","clientWidth","clientHeight","devicePixelRatio","observe","disconnect","useLatestFunc","RowSelectionContext","RowSelectionProvider","RowSelectionChangeContext","RowSelectionChangeProvider","rowSelectionContext","rowSelectionChangeContext","useViewportColumns","summaryRows","rowOverscanStartIdx","rowOverscanEndIdx","startIdx","updateStartIdx","viewportColumns","RENDER_BATCH_SIZE","isReadonlyArray","arr","useViewportRows","rawRows","rowHeight","scrollTop","rowGrouper","expandedGroupIds","groupedRows","groupRows","groupByKey","remainingGroupByKeys","startRowIndex","groupRowsCount","groups","childRows","entries","childGroups","childRowsCount","allGroupRows","flattenedRows","expandGroup","parentId","level","keys","posInSet","id","setSize","totalRowHeight","getRowTop","getRowHeight","findRowIdx","offset","rowPositions","currentRowHeight","top","height","validateRowIdx","start","end","middle","currentOffset","overscanThreshold","rowVisibleStartIdx","rowVisibleEndIdx","headerSortCell","headerSortCellClassname","headerSortName","headerSortNameClassname","SortableHeaderCell","onSort","sortDirection","priority","sortText","cellResizable","cellResizableClassname","HeaderCell","onResize","sortColumns","onSortColumnsChange","onPointerDown","pointerType","buttons","currentTarget","pointerId","right","getBoundingClientRect","clientX","onPointerMove","onPointerUp","preventDefault","sortIndex","findIndex","columnKey","sortColumn","direction","ariaSort","ctrlClick","sortDescendingFirst","nextSort","nextSortColumn","nextSortColumns","getCell","headerCellClass","HeaderRow","rowKeyGetter","onSelectedRowsChange","onColumnResize","handleAllRowsSelectionChange","newSelectedRows","cells","cellCopied","cellCopiedClassname","cellDraggedOver","cellDraggedOverClassname","cellDragHandle","cellDragHandleClassname","Cell","isCopied","isDraggedOver","dragHandleProps","onRowClick","onDoubleClick","onContextMenu","onRowChange","selectCell","cellClass","selectCellWrapper","openEditor","handleClick","editorOptions","editOnClick","handleContextMenu","handleDoubleClick","handleRowChange","newRow","cellEditing","cellEditingClassname","EditCell","onClose","onKeyDown","editorPortalTarget","frameRequestRef","commitOnOutsideMouseDown","cancelFrameRequest","onWindowCaptureMouseDown","capture","Row","cellRenderer","copiedCellIdx","draggedOverCellIdx","selectedCellProps","rowClass","setDraggedOverRowIdx","onMouseEnter","handleDragEnter","CellRenderer","mode","editorProps","onFocus","GroupCell","groupColumnIndex","toggleGroupWrapper","isLevelMatching","cursor","GroupedRow","selectedCellIdx","selectGroup","SummaryCell","summaryFormatter","SummaryFormatter","summaryCellClass","SummaryRow","bottom","ariaRowIndex","body","globalThis","initialPosition","DataGrid","onRowsChange","headerRowHeight","rawHeaderRowHeight","summaryRowHeight","rawSummaryRowHeight","selectedRows","onExpandedGroupIdsChange","rowRenderer","emptyRowsRenderer","EmptyRowsRenderer","onScroll","onSelectedCellChange","onFill","onPaste","rawCellNavigationMode","rawEditorPortalTarget","ariaDescribedBy","RowRenderer","setScrollTop","setScrollLeft","setColumnWidths","setSelectedPosition","copiedCell","setCopiedCell","isDragging","setDragging","draggedOverRowIdx","setOverRowIdx","focusSinkRef","prevSelectedPosition","latestDraggedOverRowIdx","lastSelectedRowIdx","isCellFocusable","selectRowWrapper","selectRow","handleFormatterRowChangeWrapper","updateRow","headerRowsCount","summaryRowsCount","isSelectable","hasGroups","minColIdx","enableCellDragAndDrop","scrollToCell","element","scrollToColumn","scrollToRow","scrollTo","behavior","handleColumnResize","newColumnWidths","childRow","rowKey","previousRowIdx","step","expandedGroupId","newExpandedGroupIds","onGridFocus","keyCode","cKey","vKey","handleCopy","handlePaste","closeEditor","navigate","handleCellInput","handleFocus","handleScroll","getRawRowIdx","updatedRows","indexes","commitEditorChanges","originalRow","targetRow","updatedTargetRow","sourceRow","sourceColumnKey","targetColumnKey","onCellKeyDown","handleDragEnd","overRowIdx","endRowIndex","targetRows","updatedTargetRows","targetRowIdx","handleMouseDown","onMouseOver","onMouseUp","handleEditorRowChange","commitChanges","handleOnClose","enableEditor","isCellAtLeftBoundary","isCellAtRightBoundary","rowTop","getNextPosition","parentRowIdx","parentRow","nextRowY","onNavigation","getDraggedOverCellIdx","currentRowIdx","getSelectedCellProps","onMouseDown","getViewportRows","rowElements","isGroupRowSelected","cr","React.useMemo","React.createElement","React.useState","React.useEffect","timeParse","timeFormat","format","React.useCallback","publish","HTMLWidget"],"mappings":";;;;;;AAAO,MAAM,QAAQ,GAAG;AACjB,MAAM,WAAW,GAAG;AACpB,MAAM,aAAa,GAAG;;ECF7B;EAC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