@inkandswitch/patchwork-pkg-base 0.0.74 → 0.0.76

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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js", "../node_modules/.pnpm/debug@4.4.3_supports-color@7.2.0/node_modules/debug/src/common.js", "../node_modules/.pnpm/debug@4.4.3_supports-color@7.2.0/node_modules/debug/src/browser.js", "../src/components/IsolatedDocumentArea.tsx", "../src/components/DocumentAreaRoot.tsx", "../node_modules/.pnpm/@solid-primitives+storage@4.4.0_solid-js@1.9.13/node_modules/@solid-primitives/storage/dist/persisted.js", "../src/hooks/useSidebarState.ts", "../src/hooks/useSidebarResize.ts", "../src/hooks/useProviderReady.ts", "../src/hooks/useMainDocMounted.ts", "../src/hooks/useTaggedComponents.ts", "../src/hooks/useDebugRegistryToast.tsx", "../src/components/FrameTopBar.tsx", "../src/components/DocumentTitle.tsx", "../node_modules/.pnpm/cabbages@0.2.10_supports-color@7.2.0/node_modules/cabbages/output/cabbages.js", "../node_modules/.pnpm/solid-automerge@2.0.2_@automerge+automerge-repo@2.6.0-subduction.29_supports-color@7.2._4dbace68d7abbb95ae1519fb33906a50/node_modules/solid-automerge/src/autoproduce.ts", "../node_modules/.pnpm/solid-automerge@2.0.2_@automerge+automerge-repo@2.6.0-subduction.29_supports-color@7.2._4dbace68d7abbb95ae1519fb33906a50/node_modules/solid-automerge/src/createDocumentProjection.ts", "../node_modules/.pnpm/solid-automerge@2.0.2_@automerge+automerge-repo@2.6.0-subduction.29_supports-color@7.2._4dbace68d7abbb95ae1519fb33906a50/node_modules/solid-automerge/src/makeDocumentProjection.ts", "../node_modules/.pnpm/@solid-primitives+utils@6.4.1_solid-js@1.9.13/node_modules/@solid-primitives/utils/dist/index.js", "../node_modules/.pnpm/solid-automerge@2.0.2_@automerge+automerge-repo@2.6.0-subduction.29_supports-color@7.2._4dbace68d7abbb95ae1519fb33906a50/node_modules/solid-automerge/src/useDocHandle.ts", "../node_modules/.pnpm/solid-automerge@2.0.2_@automerge+automerge-repo@2.6.0-subduction.29_supports-color@7.2._4dbace68d7abbb95ae1519fb33906a50/node_modules/solid-automerge/src/context.ts", "../node_modules/.pnpm/solid-automerge@2.0.2_@automerge+automerge-repo@2.6.0-subduction.29_supports-color@7.2._4dbace68d7abbb95ae1519fb33906a50/node_modules/solid-automerge/src/useDocument.ts", "../node_modules/.pnpm/solid-automerge@2.0.2_@automerge+automerge-repo@2.6.0-subduction.29_supports-color@7.2._4dbace68d7abbb95ae1519fb33906a50/node_modules/solid-automerge/src/makeDocSignal.ts", "../node_modules/.pnpm/solid-automerge@2.0.2_@automerge+automerge-repo@2.6.0-subduction.29_supports-color@7.2._4dbace68d7abbb95ae1519fb33906a50/node_modules/solid-automerge/src/createDocSignal.ts", "../node_modules/.pnpm/solid-automerge@2.0.2_@automerge+automerge-repo@2.6.0-subduction.29_supports-color@7.2._4dbace68d7abbb95ae1519fb33906a50/node_modules/solid-automerge/src/useRepo.ts", "../src/components/ContextSidebar.tsx", "../src/components/Sidebar.tsx", "../src/components/ContextTabs.tsx", "../src/components/SlotView.tsx", "../src/components/MainDocumentView.tsx", "../src/styles.css", "../src/ensureFrameStyles.ts"],
4
- "sourcesContent": ["/**\n * Helpers.\n */\n\nvar s = 1000;\nvar m = s * 60;\nvar h = m * 60;\nvar d = h * 24;\nvar w = d * 7;\nvar y = d * 365.25;\n\n/**\n * Parse or format the given `val`.\n *\n * Options:\n *\n * - `long` verbose formatting [false]\n *\n * @param {String|Number} val\n * @param {Object} [options]\n * @throws {Error} throw an error if val is not a non-empty string or a number\n * @return {String|Number}\n * @api public\n */\n\nmodule.exports = function (val, options) {\n options = options || {};\n var type = typeof val;\n if (type === 'string' && val.length > 0) {\n return parse(val);\n } else if (type === 'number' && isFinite(val)) {\n return options.long ? fmtLong(val) : fmtShort(val);\n }\n throw new Error(\n 'val is not a non-empty string or a valid number. val=' +\n JSON.stringify(val)\n );\n};\n\n/**\n * Parse the given `str` and return milliseconds.\n *\n * @param {String} str\n * @return {Number}\n * @api private\n */\n\nfunction parse(str) {\n str = String(str);\n if (str.length > 100) {\n return;\n }\n var match = /^(-?(?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(\n str\n );\n if (!match) {\n return;\n }\n var n = parseFloat(match[1]);\n var type = (match[2] || 'ms').toLowerCase();\n switch (type) {\n case 'years':\n case 'year':\n case 'yrs':\n case 'yr':\n case 'y':\n return n * y;\n case 'weeks':\n case 'week':\n case 'w':\n return n * w;\n case 'days':\n case 'day':\n case 'd':\n return n * d;\n case 'hours':\n case 'hour':\n case 'hrs':\n case 'hr':\n case 'h':\n return n * h;\n case 'minutes':\n case 'minute':\n case 'mins':\n case 'min':\n case 'm':\n return n * m;\n case 'seconds':\n case 'second':\n case 'secs':\n case 'sec':\n case 's':\n return n * s;\n case 'milliseconds':\n case 'millisecond':\n case 'msecs':\n case 'msec':\n case 'ms':\n return n;\n default:\n return undefined;\n }\n}\n\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtShort(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return Math.round(ms / d) + 'd';\n }\n if (msAbs >= h) {\n return Math.round(ms / h) + 'h';\n }\n if (msAbs >= m) {\n return Math.round(ms / m) + 'm';\n }\n if (msAbs >= s) {\n return Math.round(ms / s) + 's';\n }\n return ms + 'ms';\n}\n\n/**\n * Long format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtLong(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return plural(ms, msAbs, d, 'day');\n }\n if (msAbs >= h) {\n return plural(ms, msAbs, h, 'hour');\n }\n if (msAbs >= m) {\n return plural(ms, msAbs, m, 'minute');\n }\n if (msAbs >= s) {\n return plural(ms, msAbs, s, 'second');\n }\n return ms + ' ms';\n}\n\n/**\n * Pluralization helper.\n */\n\nfunction plural(ms, msAbs, n, name) {\n var isPlural = msAbs >= n * 1.5;\n return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');\n}\n", "\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n */\n\nfunction setup(env) {\n\tcreateDebug.debug = createDebug;\n\tcreateDebug.default = createDebug;\n\tcreateDebug.coerce = coerce;\n\tcreateDebug.disable = disable;\n\tcreateDebug.enable = enable;\n\tcreateDebug.enabled = enabled;\n\tcreateDebug.humanize = require('ms');\n\tcreateDebug.destroy = destroy;\n\n\tObject.keys(env).forEach(key => {\n\t\tcreateDebug[key] = env[key];\n\t});\n\n\t/**\n\t* The currently active debug mode names, and names to skip.\n\t*/\n\n\tcreateDebug.names = [];\n\tcreateDebug.skips = [];\n\n\t/**\n\t* Map of special \"%n\" handling functions, for the debug \"format\" argument.\n\t*\n\t* Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n\t*/\n\tcreateDebug.formatters = {};\n\n\t/**\n\t* Selects a color for a debug namespace\n\t* @param {String} namespace The namespace string for the debug instance to be colored\n\t* @return {Number|String} An ANSI color code for the given namespace\n\t* @api private\n\t*/\n\tfunction selectColor(namespace) {\n\t\tlet hash = 0;\n\n\t\tfor (let i = 0; i < namespace.length; i++) {\n\t\t\thash = ((hash << 5) - hash) + namespace.charCodeAt(i);\n\t\t\thash |= 0; // Convert to 32bit integer\n\t\t}\n\n\t\treturn createDebug.colors[Math.abs(hash) % createDebug.colors.length];\n\t}\n\tcreateDebug.selectColor = selectColor;\n\n\t/**\n\t* Create a debugger with the given `namespace`.\n\t*\n\t* @param {String} namespace\n\t* @return {Function}\n\t* @api public\n\t*/\n\tfunction createDebug(namespace) {\n\t\tlet prevTime;\n\t\tlet enableOverride = null;\n\t\tlet namespacesCache;\n\t\tlet enabledCache;\n\n\t\tfunction debug(...args) {\n\t\t\t// Disabled?\n\t\t\tif (!debug.enabled) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst self = debug;\n\n\t\t\t// Set `diff` timestamp\n\t\t\tconst curr = Number(new Date());\n\t\t\tconst ms = curr - (prevTime || curr);\n\t\t\tself.diff = ms;\n\t\t\tself.prev = prevTime;\n\t\t\tself.curr = curr;\n\t\t\tprevTime = curr;\n\n\t\t\targs[0] = createDebug.coerce(args[0]);\n\n\t\t\tif (typeof args[0] !== 'string') {\n\t\t\t\t// Anything else let's inspect with %O\n\t\t\t\targs.unshift('%O');\n\t\t\t}\n\n\t\t\t// Apply any `formatters` transformations\n\t\t\tlet index = 0;\n\t\t\targs[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {\n\t\t\t\t// If we encounter an escaped % then don't increase the array index\n\t\t\t\tif (match === '%%') {\n\t\t\t\t\treturn '%';\n\t\t\t\t}\n\t\t\t\tindex++;\n\t\t\t\tconst formatter = createDebug.formatters[format];\n\t\t\t\tif (typeof formatter === 'function') {\n\t\t\t\t\tconst val = args[index];\n\t\t\t\t\tmatch = formatter.call(self, val);\n\n\t\t\t\t\t// Now we need to remove `args[index]` since it's inlined in the `format`\n\t\t\t\t\targs.splice(index, 1);\n\t\t\t\t\tindex--;\n\t\t\t\t}\n\t\t\t\treturn match;\n\t\t\t});\n\n\t\t\t// Apply env-specific formatting (colors, etc.)\n\t\t\tcreateDebug.formatArgs.call(self, args);\n\n\t\t\tconst logFn = self.log || createDebug.log;\n\t\t\tlogFn.apply(self, args);\n\t\t}\n\n\t\tdebug.namespace = namespace;\n\t\tdebug.useColors = createDebug.useColors();\n\t\tdebug.color = createDebug.selectColor(namespace);\n\t\tdebug.extend = extend;\n\t\tdebug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release.\n\n\t\tObject.defineProperty(debug, 'enabled', {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: false,\n\t\t\tget: () => {\n\t\t\t\tif (enableOverride !== null) {\n\t\t\t\t\treturn enableOverride;\n\t\t\t\t}\n\t\t\t\tif (namespacesCache !== createDebug.namespaces) {\n\t\t\t\t\tnamespacesCache = createDebug.namespaces;\n\t\t\t\t\tenabledCache = createDebug.enabled(namespace);\n\t\t\t\t}\n\n\t\t\t\treturn enabledCache;\n\t\t\t},\n\t\t\tset: v => {\n\t\t\t\tenableOverride = v;\n\t\t\t}\n\t\t});\n\n\t\t// Env-specific initialization logic for debug instances\n\t\tif (typeof createDebug.init === 'function') {\n\t\t\tcreateDebug.init(debug);\n\t\t}\n\n\t\treturn debug;\n\t}\n\n\tfunction extend(namespace, delimiter) {\n\t\tconst newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);\n\t\tnewDebug.log = this.log;\n\t\treturn newDebug;\n\t}\n\n\t/**\n\t* Enables a debug mode by namespaces. This can include modes\n\t* separated by a colon and wildcards.\n\t*\n\t* @param {String} namespaces\n\t* @api public\n\t*/\n\tfunction enable(namespaces) {\n\t\tcreateDebug.save(namespaces);\n\t\tcreateDebug.namespaces = namespaces;\n\n\t\tcreateDebug.names = [];\n\t\tcreateDebug.skips = [];\n\n\t\tconst split = (typeof namespaces === 'string' ? namespaces : '')\n\t\t\t.trim()\n\t\t\t.replace(/\\s+/g, ',')\n\t\t\t.split(',')\n\t\t\t.filter(Boolean);\n\n\t\tfor (const ns of split) {\n\t\t\tif (ns[0] === '-') {\n\t\t\t\tcreateDebug.skips.push(ns.slice(1));\n\t\t\t} else {\n\t\t\t\tcreateDebug.names.push(ns);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Checks if the given string matches a namespace template, honoring\n\t * asterisks as wildcards.\n\t *\n\t * @param {String} search\n\t * @param {String} template\n\t * @return {Boolean}\n\t */\n\tfunction matchesTemplate(search, template) {\n\t\tlet searchIndex = 0;\n\t\tlet templateIndex = 0;\n\t\tlet starIndex = -1;\n\t\tlet matchIndex = 0;\n\n\t\twhile (searchIndex < search.length) {\n\t\t\tif (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === '*')) {\n\t\t\t\t// Match character or proceed with wildcard\n\t\t\t\tif (template[templateIndex] === '*') {\n\t\t\t\t\tstarIndex = templateIndex;\n\t\t\t\t\tmatchIndex = searchIndex;\n\t\t\t\t\ttemplateIndex++; // Skip the '*'\n\t\t\t\t} else {\n\t\t\t\t\tsearchIndex++;\n\t\t\t\t\ttemplateIndex++;\n\t\t\t\t}\n\t\t\t} else if (starIndex !== -1) { // eslint-disable-line no-negated-condition\n\t\t\t\t// Backtrack to the last '*' and try to match more characters\n\t\t\t\ttemplateIndex = starIndex + 1;\n\t\t\t\tmatchIndex++;\n\t\t\t\tsearchIndex = matchIndex;\n\t\t\t} else {\n\t\t\t\treturn false; // No match\n\t\t\t}\n\t\t}\n\n\t\t// Handle trailing '*' in template\n\t\twhile (templateIndex < template.length && template[templateIndex] === '*') {\n\t\t\ttemplateIndex++;\n\t\t}\n\n\t\treturn templateIndex === template.length;\n\t}\n\n\t/**\n\t* Disable debug output.\n\t*\n\t* @return {String} namespaces\n\t* @api public\n\t*/\n\tfunction disable() {\n\t\tconst namespaces = [\n\t\t\t...createDebug.names,\n\t\t\t...createDebug.skips.map(namespace => '-' + namespace)\n\t\t].join(',');\n\t\tcreateDebug.enable('');\n\t\treturn namespaces;\n\t}\n\n\t/**\n\t* Returns true if the given mode name is enabled, false otherwise.\n\t*\n\t* @param {String} name\n\t* @return {Boolean}\n\t* @api public\n\t*/\n\tfunction enabled(name) {\n\t\tfor (const skip of createDebug.skips) {\n\t\t\tif (matchesTemplate(name, skip)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tfor (const ns of createDebug.names) {\n\t\t\tif (matchesTemplate(name, ns)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t* Coerce `val`.\n\t*\n\t* @param {Mixed} val\n\t* @return {Mixed}\n\t* @api private\n\t*/\n\tfunction coerce(val) {\n\t\tif (val instanceof Error) {\n\t\t\treturn val.stack || val.message;\n\t\t}\n\t\treturn val;\n\t}\n\n\t/**\n\t* XXX DO NOT USE. This is a temporary stub function.\n\t* XXX It WILL be removed in the next major release.\n\t*/\n\tfunction destroy() {\n\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t}\n\n\tcreateDebug.enable(createDebug.load());\n\n\treturn createDebug;\n}\n\nmodule.exports = setup;\n", "/* eslint-env browser */\n\n/**\n * This is the web browser implementation of `debug()`.\n */\n\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = localstorage();\nexports.destroy = (() => {\n\tlet warned = false;\n\n\treturn () => {\n\t\tif (!warned) {\n\t\t\twarned = true;\n\t\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t\t}\n\t};\n})();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n\t'#0000CC',\n\t'#0000FF',\n\t'#0033CC',\n\t'#0033FF',\n\t'#0066CC',\n\t'#0066FF',\n\t'#0099CC',\n\t'#0099FF',\n\t'#00CC00',\n\t'#00CC33',\n\t'#00CC66',\n\t'#00CC99',\n\t'#00CCCC',\n\t'#00CCFF',\n\t'#3300CC',\n\t'#3300FF',\n\t'#3333CC',\n\t'#3333FF',\n\t'#3366CC',\n\t'#3366FF',\n\t'#3399CC',\n\t'#3399FF',\n\t'#33CC00',\n\t'#33CC33',\n\t'#33CC66',\n\t'#33CC99',\n\t'#33CCCC',\n\t'#33CCFF',\n\t'#6600CC',\n\t'#6600FF',\n\t'#6633CC',\n\t'#6633FF',\n\t'#66CC00',\n\t'#66CC33',\n\t'#9900CC',\n\t'#9900FF',\n\t'#9933CC',\n\t'#9933FF',\n\t'#99CC00',\n\t'#99CC33',\n\t'#CC0000',\n\t'#CC0033',\n\t'#CC0066',\n\t'#CC0099',\n\t'#CC00CC',\n\t'#CC00FF',\n\t'#CC3300',\n\t'#CC3333',\n\t'#CC3366',\n\t'#CC3399',\n\t'#CC33CC',\n\t'#CC33FF',\n\t'#CC6600',\n\t'#CC6633',\n\t'#CC9900',\n\t'#CC9933',\n\t'#CCCC00',\n\t'#CCCC33',\n\t'#FF0000',\n\t'#FF0033',\n\t'#FF0066',\n\t'#FF0099',\n\t'#FF00CC',\n\t'#FF00FF',\n\t'#FF3300',\n\t'#FF3333',\n\t'#FF3366',\n\t'#FF3399',\n\t'#FF33CC',\n\t'#FF33FF',\n\t'#FF6600',\n\t'#FF6633',\n\t'#FF9900',\n\t'#FF9933',\n\t'#FFCC00',\n\t'#FFCC33'\n];\n\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\n// eslint-disable-next-line complexity\nfunction useColors() {\n\t// NB: In an Electron preload script, document will be defined but not fully\n\t// initialized. Since we know we're in Chrome, we'll just detect this case\n\t// explicitly\n\tif (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {\n\t\treturn true;\n\t}\n\n\t// Internet Explorer and Edge do not support colors.\n\tif (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\\/(\\d+)/)) {\n\t\treturn false;\n\t}\n\n\tlet m;\n\n\t// Is webkit? http://stackoverflow.com/a/16459606/376773\n\t// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n\t// eslint-disable-next-line no-return-assign\n\treturn (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||\n\t\t// Is firebug? http://stackoverflow.com/a/398120/376773\n\t\t(typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||\n\t\t// Is firefox >= v31?\n\t\t// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/)) && parseInt(m[1], 10) >= 31) ||\n\t\t// Double check webkit in userAgent just in case we are in a worker\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/));\n}\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n\targs[0] = (this.useColors ? '%c' : '') +\n\t\tthis.namespace +\n\t\t(this.useColors ? ' %c' : ' ') +\n\t\targs[0] +\n\t\t(this.useColors ? '%c ' : ' ') +\n\t\t'+' + module.exports.humanize(this.diff);\n\n\tif (!this.useColors) {\n\t\treturn;\n\t}\n\n\tconst c = 'color: ' + this.color;\n\targs.splice(1, 0, c, 'color: inherit');\n\n\t// The final \"%c\" is somewhat tricky, because there could be other\n\t// arguments passed either before or after the %c, so we need to\n\t// figure out the correct index to insert the CSS into\n\tlet index = 0;\n\tlet lastC = 0;\n\targs[0].replace(/%[a-zA-Z%]/g, match => {\n\t\tif (match === '%%') {\n\t\t\treturn;\n\t\t}\n\t\tindex++;\n\t\tif (match === '%c') {\n\t\t\t// We only are interested in the *last* %c\n\t\t\t// (the user may have provided their own)\n\t\t\tlastC = index;\n\t\t}\n\t});\n\n\targs.splice(lastC, 0, c);\n}\n\n/**\n * Invokes `console.debug()` when available.\n * No-op when `console.debug` is not a \"function\".\n * If `console.debug` is not available, falls back\n * to `console.log`.\n *\n * @api public\n */\nexports.log = console.debug || console.log || (() => {});\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\nfunction save(namespaces) {\n\ttry {\n\t\tif (namespaces) {\n\t\t\texports.storage.setItem('debug', namespaces);\n\t\t} else {\n\t\t\texports.storage.removeItem('debug');\n\t\t}\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\nfunction load() {\n\tlet r;\n\ttry {\n\t\tr = exports.storage.getItem('debug') || exports.storage.getItem('DEBUG') ;\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n\n\t// If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n\tif (!r && typeof process !== 'undefined' && 'env' in process) {\n\t\tr = process.env.DEBUG;\n\t}\n\n\treturn r;\n}\n\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\nfunction localstorage() {\n\ttry {\n\t\t// TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context\n\t\t// The Browser also has localStorage in the global context.\n\t\treturn localStorage;\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\nmodule.exports = require('./common')(exports);\n\nconst {formatters} = module.exports;\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nformatters.j = function (v) {\n\ttry {\n\t\treturn JSON.stringify(v);\n\t} catch (error) {\n\t\treturn '[UnexpectedJSONParseError]: ' + error.message;\n\t}\n};\n", "import { template as _$template } from \"solid-js/web\";\nimport { createComponent as _$createComponent } from \"solid-js/web\";\nimport { setAttribute as _$setAttribute } from \"solid-js/web\";\nimport { effect as _$effect } from \"solid-js/web\";\nimport { insert as _$insert } from \"solid-js/web\";\nimport { getOwner as _$getOwner } from \"solid-js/web\";\nvar _tmpl$ = /*#__PURE__*/_$template(`<patchwork-view component=patchwork-isolation root-component=threepane-isolation-root shared-providers=patchwork:contact,patchwork:selected-doc,patchwork:worker-channel shared-tools=llm-config-tray style=display:contents><script type=application/json data-root-component-data>`, true, false, false),\n _tmpl$2 = /*#__PURE__*/_$template(`<div class=frame>`);\nimport { createMemo } from \"solid-js\";\nimport { createStore, reconcile } from \"solid-js/store\";\nimport { render } from \"solid-js/web\";\nimport { DocumentAreaRoot } from \"./DocumentAreaRoot\";\nimport { DEFAULT_SIDEBAR_WIDTH } from \"../hooks\";\nimport { ensureFrameStyles } from \"../ensureFrameStyles\";\nexport function IsolatedDocumentArea(props) {\n const rootUrls = createMemo(() => {\n const urls = /* @__PURE__ */new Set();\n const selected = props.selectedDocUrl();\n if (selected) urls.add(selected);\n if (props.contactUrl) urls.add(props.contactUrl);\n return [...urls];\n });\n const propsJson = createMemo(() => JSON.stringify({\n selectedDocUrl: props.selectedDocUrl(),\n selectedToolId: props.selectedToolId(),\n doctitleSlots: props.doctitleSlots(),\n isLeftCollapsed: props.isLeftCollapsed(),\n initialRightWidth: props.initialRightWidth(),\n initialRightCollapsed: props.initialRightCollapsed()\n }));\n return (() => {\n var _el$ = _tmpl$(),\n _el$2 = _el$.firstChild;\n _el$._$owner = _$getOwner();\n _$insert(_el$2, propsJson);\n _$effect(() => _$setAttribute(_el$, \"automerge-allowlist\", rootUrls().join(\",\")));\n return _el$;\n })();\n}\nfunction parseProps(script) {\n if (!script?.textContent) return {};\n try {\n return JSON.parse(script.textContent);\n } catch (err) {\n console.error(\"[threepane-isolation-root] bad props JSON:\", err);\n return {};\n }\n}\nexport function mountIsolationRoot(element) {\n ensureFrameStyles();\n const script = element.querySelector('script[type=\"application/json\"]');\n const [p, setP] = createStore(parseProps(script));\n const observer = new MutationObserver(() => {\n setP(reconcile(parseProps(script)));\n });\n if (script) {\n observer.observe(script, {\n characterData: true,\n childList: true,\n subtree: true\n });\n }\n const dispose = render(() => (() => {\n var _el$3 = _tmpl$2();\n _$insert(_el$3, _$createComponent(DocumentAreaRoot, {\n selectedDocUrl: () => p.selectedDocUrl,\n selectedToolId: () => p.selectedToolId,\n doctitleSlots: () => p.doctitleSlots,\n isLeftCollapsed: () => p.isLeftCollapsed ?? false,\n initialRightWidth: () => p.initialRightWidth ?? DEFAULT_SIDEBAR_WIDTH,\n initialRightCollapsed: () => p.initialRightCollapsed ?? false\n }));\n return _el$3;\n })(), element);\n return () => {\n observer.disconnect();\n dispose();\n };\n}", "import { template as _$template } from \"solid-js/web\";\nimport { insert as _$insert } from \"solid-js/web\";\nimport { getOwner as _$getOwner } from \"solid-js/web\";\nimport { use as _$use } from \"solid-js/web\";\nimport { createComponent as _$createComponent } from \"solid-js/web\";\nvar _tmpl$ = /*#__PURE__*/_$template(`<patchwork-view component=patchwork-draft-state-provider>`, true, false, false),\n _tmpl$2 = /*#__PURE__*/_$template(`<div class=frame__main-column><div class=frame__doc-column><div class=main-area>`),\n _tmpl$3 = /*#__PURE__*/_$template(`<patchwork-view component=patchwork-draft-overlay-provider><patchwork-view component=patchwork-comments-provider><patchwork-view component=patchwork-focus-provider>`, true, false, false);\nimport { makePersisted } from \"@solid-primitives/storage\";\nimport { createEffect, createMemo, createSignal, on, onCleanup, onMount, Show } from \"solid-js\";\nimport { useProviderReady, useTaggedComponents, SIDEBAR_KEYS, COLLAPSE_CONTEXT_SIDEBAR_EVENT } from \"../hooks\";\nimport { useSidebarResize } from \"../hooks/useSidebarResize\";\nimport { FrameTopBar } from \"./FrameTopBar\";\nimport { ContextSidebar } from \"./ContextSidebar\";\nimport { MainDocumentView } from \"./MainDocumentView\";\nconst MIN_SIDEBAR_WIDTH = 180;\nconst MAX_SIDEBAR_WIDTH = 720;\nconst AUTO_CLOSE_WIDTH = 120;\nconst DRAG_THRESHOLD = 3;\nexport function DocumentAreaRoot(props) {\n const [isRightSidebarCollapsed, setIsRightSidebarCollapsed] = createSignal(props.initialRightCollapsed());\n const [rightSidebarWidth, setRightSidebarWidth] = createSignal(props.initialRightWidth());\n createEffect(on(isRightSidebarCollapsed, value => {\n try {\n localStorage.setItem(SIDEBAR_KEYS.rightCollapsed, String(value));\n } catch {}\n }, {\n defer: true\n }));\n createEffect(on(rightSidebarWidth, value => {\n try {\n localStorage.setItem(SIDEBAR_KEYS.rightWidth, String(value));\n } catch {}\n }, {\n defer: true\n }));\n const [, setUnusedLeftWidth] = createSignal(0);\n const [, setUnusedLeftCollapsed] = createSignal(false);\n const sidebarResize = useSidebarResize({\n setLeftSidebarWidth: setUnusedLeftWidth,\n setRightSidebarWidth,\n setIsSidebarCollapsed: setUnusedLeftCollapsed,\n setIsRightSidebarCollapsed,\n isLeftCollapsed: () => props.isLeftCollapsed(),\n isRightCollapsed: isRightSidebarCollapsed,\n minWidth: MIN_SIDEBAR_WIDTH,\n maxWidth: MAX_SIDEBAR_WIDTH,\n autoCloseWidth: AUTO_CLOSE_WIDTH,\n dragThreshold: DRAG_THRESHOLD\n });\n onMount(() => {\n const onCollapse = () => setIsRightSidebarCollapsed(true);\n window.addEventListener(COLLAPSE_CONTEXT_SIDEBAR_EVENT, onCollapse);\n onCleanup(() => window.removeEventListener(COLLAPSE_CONTEXT_SIDEBAR_EVENT, onCollapse));\n });\n const [selectedContextToolId, setSelectedContextToolId] = makePersisted(createSignal(), {\n name: SIDEBAR_KEYS.contextToolId\n });\n const [draftStateProviderHost, setDraftStateProviderHost] = createSignal();\n const isDraftStateProviderReady = useProviderReady(\"patchwork-draft-state-provider\", draftStateProviderHost);\n const readyDraftStateHost = () => isDraftStateProviderReady() ? draftStateProviderHost() : void 0;\n return _$createComponent(Show, {\n get when() {\n return props.selectedDocUrl();\n },\n keyed: true,\n children: docUrl => (() => {\n var _el$ = _tmpl$();\n _$use(setDraftStateProviderHost, _el$);\n _el$.docUrl = docUrl;\n _el$._$owner = _$getOwner();\n _$insert(_el$, _$createComponent(Show, {\n get when() {\n return readyDraftStateHost();\n },\n children: host => _$createComponent(DraftDocumentArea, {\n get host() {\n return host();\n },\n get setMainDocElement() {\n return props.setMainDocElement;\n },\n get selectedDocUrl() {\n return props.selectedDocUrl;\n },\n get selectedToolId() {\n return props.selectedToolId;\n },\n get doctitleSlots() {\n return props.doctitleSlots;\n },\n get isLeftCollapsed() {\n return props.isLeftCollapsed;\n },\n isRightSidebarCollapsed: isRightSidebarCollapsed,\n setIsRightSidebarCollapsed: setIsRightSidebarCollapsed,\n rightSidebarWidth: rightSidebarWidth,\n get handleMouseDown() {\n return sidebarResize.handleMouseDown;\n },\n get handleToggleClick() {\n return sidebarResize.handleToggleClick;\n },\n selectedContextToolId: selectedContextToolId,\n setSelectedContextToolId: setSelectedContextToolId\n })\n }));\n return _el$;\n })()\n });\n}\nfunction DraftDocumentArea(props) {\n const contextItems = useTaggedComponents(\"context-tool\");\n const hasContext = () => contextItems().length > 0;\n const mainViewKey = createMemo(() => props.selectedDocUrl());\n const [draftOverlayProviderHost, setDraftOverlayProviderHost] = createSignal();\n const isDraftOverlayProviderReady = useProviderReady(\"patchwork-draft-overlay-provider\", draftOverlayProviderHost);\n const [commentsProviderElement, setCommentsProviderElement] = createSignal();\n const isCommentsProviderReady = useProviderReady(\"patchwork-comments-provider\", commentsProviderElement);\n const [focusProviderElement, setFocusProviderElement] = createSignal();\n const isFocusProviderReady = useProviderReady(\"patchwork-focus-provider\", focusProviderElement);\n const areDocProvidersReady = createMemo(() => isDraftOverlayProviderReady() && isCommentsProviderReady() && isFocusProviderReady());\n return (() => {\n var _el$2 = _tmpl$3(),\n _el$3 = _el$2.firstChild,\n _el$4 = _el$3.firstChild;\n _$use(setDraftOverlayProviderHost, _el$2);\n _el$2._$owner = _$getOwner();\n _$use(setCommentsProviderElement, _el$3);\n _el$3._$owner = _$getOwner();\n _$use(setFocusProviderElement, _el$4);\n _el$4._$owner = _$getOwner();\n _$insert(_el$4, _$createComponent(Show, {\n get when() {\n return areDocProvidersReady();\n },\n get children() {\n var _el$5 = _tmpl$2(),\n _el$6 = _el$5.firstChild,\n _el$7 = _el$6.firstChild;\n _$insert(_el$6, _$createComponent(FrameTopBar, {\n get docUrl() {\n return props.selectedDocUrl;\n },\n get toolSlots() {\n return props.doctitleSlots;\n },\n get isLeftCollapsed() {\n return props.isLeftCollapsed;\n },\n hasContext: hasContext,\n get isRightCollapsed() {\n return props.isRightSidebarCollapsed;\n },\n onToggleRight: () => props.setIsRightSidebarCollapsed(v => !v)\n }), _el$7);\n _$insert(_el$7, _$createComponent(MainDocumentView, {\n viewKey: mainViewKey,\n get selectedDocUrl() {\n return props.selectedDocUrl;\n },\n get toolId() {\n return props.selectedToolId;\n },\n ref: el => props.setMainDocElement?.(el)\n }));\n _$insert(_el$5, _$createComponent(Show, {\n get when() {\n return hasContext();\n },\n get children() {\n return _$createComponent(ContextSidebar, {\n get selectedToolId() {\n return props.selectedContextToolId;\n },\n get setSelectedToolId() {\n return props.setSelectedContextToolId;\n },\n get isCollapsed() {\n return props.isRightSidebarCollapsed;\n },\n get width() {\n return props.rightSidebarWidth;\n },\n get onMouseDown() {\n return props.handleMouseDown;\n },\n get onToggleClick() {\n return props.handleToggleClick;\n },\n onCollapse: () => props.setIsRightSidebarCollapsed(true)\n });\n }\n }), null);\n return _el$5;\n }\n }));\n return _el$2;\n })();\n}", "import { createUniqueId, untrack } from \"solid-js\";\nimport { isServer, isDev } from \"solid-js/web\";\nimport { reconcile } from \"solid-js/store\";\nexport function makePersisted(signal, options = {}) {\n const storage = options.storage || globalThis.localStorage;\n const name = options.name || `storage-${createUniqueId()}`;\n if (!storage) {\n return Object.assign(signal, { 2: null });\n }\n const storageOptions = options.storageOptions;\n const serialize = options.serialize || JSON.stringify.bind(JSON);\n const deserialize = options.deserialize || JSON.parse.bind(JSON);\n const init = storage.getItem(name, storageOptions);\n const set = typeof signal[0] === \"function\"\n ? (data) => {\n try {\n const value = deserialize(data);\n signal[1](() => value);\n }\n catch (e) {\n // eslint-disable-next-line no-console\n if (isDev)\n console.warn(e);\n }\n }\n : (data) => {\n try {\n const value = deserialize(data);\n signal[1](reconcile(value));\n }\n catch (e) {\n // eslint-disable-next-line no-console\n if (isDev)\n console.warn(e);\n }\n };\n let unchanged = true;\n if (init instanceof Promise)\n init.then(data => unchanged && data && set(data));\n else if (init)\n set(init);\n if (typeof options.sync?.[0] === \"function\") {\n const get = typeof signal[0] === \"function\" ? signal[0] : () => signal[0];\n options.sync[0]((data) => {\n if (data.key !== name ||\n (!isServer && (data.url || globalThis.location.href) !== globalThis.location.href) ||\n data.newValue === serialize(untrack(get))) {\n return;\n }\n set(data.newValue);\n });\n }\n return Object.assign([], signal, {\n 1: typeof signal[0] === \"function\"\n ? (value) => {\n const output = signal[1](value);\n const serialized = value != null ? serialize(output) : value;\n options.sync?.[1](name, serialized);\n if (serialized != null)\n storage.setItem(name, serialized, storageOptions);\n else\n storage.removeItem(name, storageOptions);\n unchanged = false;\n return output;\n }\n : (...args) => {\n signal[1](...args);\n const value = untrack(() => serialize(signal[0]));\n options.sync?.[1](name, value);\n storage.setItem(name, value, storageOptions);\n unchanged = false;\n },\n 2: init,\n });\n}\n/**\n * storageSync - synchronize localStorage\n * This does only work for { storage: localStorage }.\n * If you wish to use e.g. cookieStorage, you may use a different sync method\n */\nexport const storageSync = [\n (subscriber) => window.addEventListener(\"storage\", ev => subscriber(ev)),\n () => {\n /*storage already sends events fulfilling the PersistenceSyncData<T> conditions*/\n },\n];\n/**\n * messageSync - synchronize over post message or broadcast channel API\n */\nexport const messageSync = (channel = window) => [\n (subscriber) => channel.addEventListener(\"message\", ev => {\n subscriber(ev.data);\n }),\n (key, newValue) => channel.postMessage({ key, newValue, timeStamp: +new Date(), url: location.href }, location.origin),\n];\n/**\n * wsSync - syncronize persisted storage via web socket\n */\nexport const wsSync = (ws, warnOnError = isDev) => [\n (subscriber) => ws.addEventListener(\"message\", (ev) => {\n try {\n const data = JSON.parse(ev.data);\n if ([\"key\", \"newValue\", \"timeStamp\"].every(item => Object.hasOwn(data, item))) {\n subscriber(data);\n }\n }\n catch (e) {\n // eslint-disable-next-line no-console\n if (warnOnError)\n console.warn(e);\n }\n }),\n (key, newValue) => ws.send(JSON.stringify({\n key,\n newValue,\n timeStamp: +new Date(),\n ...(isServer ? {} : { url: location.href }),\n })),\n];\n/**\n * multiplex arbitrary sync APIs\n *\n * ```ts\n * makePersisted(createSignal(0), { sync: multiplexSync(messageSync(bc), wsSync(ws)) })\n * ```\n */\nexport const multiplexSync = (...syncAPIs) => [\n subscriber => syncAPIs.forEach(([subscribe]) => subscribe(subscriber)),\n (key, value) => syncAPIs.forEach(([_, updater]) => updater(key, value)),\n];\n", "import { createEffect, createSignal, on } from \"solid-js\";\n\n/**\n * The localStorage keys for persisted sidebar state. Defined here, the canonical\n * sidebar-persistence module, and imported wherever sidebar state is read/written\n * (e.g. the isolated document-area root seeds + persists the right-sidebar keys),\n * so the key strings live in exactly one place.\n */\nexport const SIDEBAR_KEYS = {\n leftCollapsed: \"patchwork:leftSidebarCollapsed\",\n rightCollapsed: \"patchwork:rightSidebarCollapsed\",\n leftWidth: \"patchwork:leftSidebarWidth\",\n rightWidth: \"patchwork:rightSidebarWidth\",\n contextToolId: \"patchwork:contextSidebarToolId\",\n} as const;\n\n/**\n * DOM event (dispatched on `window`) asking the context (right) sidebar to\n * collapse. The left sidebar is host-owned and collapsed directly, but the\n * right-sidebar collapse state lives inside `DocumentAreaRoot` (so it survives\n * the isolation boundary), so the host signals it out-of-band through this event.\n */\nexport const COLLAPSE_CONTEXT_SIDEBAR_EVENT =\n \"patchwork:collapse-context-sidebar\";\n\n/** Default sidebar width (px) when nothing is persisted. */\nexport const DEFAULT_SIDEBAR_WIDTH = 400;\n\n/**\n * Reads a number from localStorage with a default fallback\n */\nexport function getStoredNumber(key: string, defaultValue: number): number {\n const stored = localStorage.getItem(key);\n return stored ? parseInt(stored, 10) : defaultValue;\n}\n\n/**\n * Reads a boolean from localStorage (returns true if value is \"true\")\n */\nexport function getStoredBoolean(key: string): boolean {\n return localStorage.getItem(key) === \"true\";\n}\n\n/**\n * Manages sidebar collapse and width state with localStorage persistence\n */\nexport function useSidebarState() {\n // Sidebar collapse state with localStorage persistence\n const [isSidebarCollapsed, setIsSidebarCollapsed] = createSignal(\n getStoredBoolean(SIDEBAR_KEYS.leftCollapsed)\n );\n const [isRightSidebarCollapsed, setIsRightSidebarCollapsed] = createSignal(\n getStoredBoolean(SIDEBAR_KEYS.rightCollapsed)\n );\n\n // Resizable sidebar width state with localStorage persistence\n const [leftSidebarWidth, setLeftSidebarWidth] = createSignal(\n getStoredNumber(SIDEBAR_KEYS.leftWidth, DEFAULT_SIDEBAR_WIDTH)\n );\n const [rightSidebarWidth, setRightSidebarWidth] = createSignal(\n getStoredNumber(SIDEBAR_KEYS.rightWidth, DEFAULT_SIDEBAR_WIDTH)\n );\n\n // Persist each sidebar state to localStorage independently\n createEffect(\n on(isSidebarCollapsed, (value) => {\n localStorage.setItem(SIDEBAR_KEYS.leftCollapsed, String(value));\n })\n );\n\n createEffect(\n on(isRightSidebarCollapsed, (value) => {\n localStorage.setItem(SIDEBAR_KEYS.rightCollapsed, String(value));\n })\n );\n\n createEffect(\n on(leftSidebarWidth, (value) => {\n localStorage.setItem(SIDEBAR_KEYS.leftWidth, String(value));\n })\n );\n\n createEffect(\n on(rightSidebarWidth, (value) => {\n localStorage.setItem(SIDEBAR_KEYS.rightWidth, String(value));\n })\n );\n\n return {\n isSidebarCollapsed,\n setIsSidebarCollapsed,\n isRightSidebarCollapsed,\n setIsRightSidebarCollapsed,\n leftSidebarWidth,\n setLeftSidebarWidth,\n rightSidebarWidth,\n setRightSidebarWidth,\n };\n}\n", "import { onCleanup, onMount } from \"solid-js\";\nimport type { Setter } from \"solid-js\";\n\ninterface UseSidebarResizeParams {\n setLeftSidebarWidth: Setter<number>;\n setRightSidebarWidth: Setter<number>;\n setIsSidebarCollapsed: Setter<boolean>;\n setIsRightSidebarCollapsed: Setter<boolean>;\n isLeftCollapsed: () => boolean;\n isRightCollapsed: () => boolean;\n minWidth: number;\n maxWidth: number;\n /** Drag narrower than this and the sidebar snaps closed (and re-opens once\n * dragged back out past it). */\n autoCloseWidth: number;\n dragThreshold: number;\n}\n\n/**\n * Manages sidebar resize and toggle interactions\n */\nexport function useSidebarResize({\n setLeftSidebarWidth,\n setRightSidebarWidth,\n setIsSidebarCollapsed,\n setIsRightSidebarCollapsed,\n isLeftCollapsed,\n isRightCollapsed,\n minWidth,\n maxWidth,\n autoCloseWidth,\n dragThreshold,\n}: UseSidebarResizeParams) {\n // Non-reactive refs for drag state\n let isResizing: \"left\" | \"right\" | null = null;\n let dragStartPos: { x: number; y: number } | null = null;\n let hasDragged = false;\n // The last *open* width applied during the live drag (null while the drag is\n // previewing a collapse). Read on release to decide whether to spring back.\n let lastDragWidth: number | null = null;\n\n const setWidth = (side: \"left\" | \"right\", w: number) =>\n side === \"left\" ? setLeftSidebarWidth(w) : setRightSidebarWidth(w);\n\n const setCollapsed = (side: \"left\" | \"right\", value: boolean) =>\n side === \"left\"\n ? setIsSidebarCollapsed(value)\n : setIsRightSidebarCollapsed(value);\n\n const isCollapsed = (side: \"left\" | \"right\") =>\n side === \"left\" ? isLeftCollapsed() : isRightCollapsed();\n\n // Apply a candidate width from a live drag. The panel tracks the pointer to\n // *any* size (Things 3 / nextaction feel) - it is allowed below `minWidth` so\n // you can see it shrink past the limit; the over-shrink is rejected later, on\n // release (see `settleDrag`). Below the auto-close threshold it snaps shut\n // live (so it reads as \"let go here and it stays closed\", and so the collapsed\n // 1px strip can be grabbed and dragged back open).\n const applyDragWidth = (side: \"left\" | \"right\", raw: number) => {\n if (raw < autoCloseWidth) {\n if (!isCollapsed(side)) setCollapsed(side, true);\n lastDragWidth = null;\n return;\n }\n if (isCollapsed(side)) setCollapsed(side, false);\n const w = Math.min(maxWidth, raw);\n setWidth(side, w);\n lastDragWidth = w;\n };\n\n // Decide the resting state when a drag ends. The width transition is live\n // again by now (the resizing flag was cleared in `endDrag`), so any width we\n // set here animates: if the drag finished too small (in the [auto-close, min)\n // band) the panel springs back out to `minWidth`; if it finished below\n // auto-close it already snapped collapsed during the drag, so we leave it.\n const settleDrag = (side: \"left\" | \"right\") => {\n if (isCollapsed(side)) return;\n if (lastDragWidth !== null && lastDragWidth < minWidth) {\n setWidth(side, minWidth);\n }\n };\n\n // A full-window overlay, added the moment a real drag begins. It keeps every\n // pointer event (and the resize cursor) on the parent document even as the\n // cursor passes over a tool iframe - otherwise the iframe swallows the\n // mousemove/mouseup and the drag can never end (\"you can't let go\"). It's\n // added lazily (not on mousedown) so a plain click still lands on the handle\n // and toggles collapse.\n let dragOverlay: HTMLDivElement | null = null;\n\n const beginDragVisuals = (side: \"left\" | \"right\") => {\n // suppress the width transition so the panel tracks the pointer 1:1, and tag\n // which side is dragging so the divider glow can extend up through the top\n // bar on that side (see `[data-sidebar-resizing]` rules in the stylesheet).\n document.body.setAttribute(\"data-sidebar-resizing\", side);\n dragOverlay = document.createElement(\"div\");\n dragOverlay.style.cssText =\n \"position:fixed;inset:0;z-index:2147483647;cursor:col-resize;\";\n document.body.appendChild(dragOverlay);\n };\n\n const endDrag = () => {\n isResizing = null;\n dragStartPos = null;\n document.body.style.userSelect = \"\";\n document.body.removeAttribute(\"data-sidebar-resizing\");\n dragOverlay?.remove();\n dragOverlay = null;\n };\n\n const handleMouseDown = (side: \"left\" | \"right\", e: MouseEvent) => {\n e.preventDefault();\n dragStartPos = { x: e.clientX, y: e.clientY };\n hasDragged = false;\n lastDragWidth = null;\n isResizing = side;\n document.body.style.userSelect = \"none\";\n };\n\n const handleMouseUp = () => {\n // Capture the drag state before endDrag() clears it, then resolve the\n // resting size with the width transition restored so spring-backs animate.\n const side = isResizing;\n const dragged = hasDragged;\n endDrag();\n if (side && dragged) settleDrag(side);\n };\n\n const handleMouseMove = (e: MouseEvent) => {\n if (!isResizing || !dragStartPos) return;\n\n // Once past the threshold this is a drag: drop the overlay in now, before\n // the cursor can reach any iframe, and suppress the width transition.\n const deltaX = Math.abs(e.clientX - dragStartPos.x);\n const deltaY = Math.abs(e.clientY - dragStartPos.y);\n if (!hasDragged && (deltaX > dragThreshold || deltaY > dragThreshold)) {\n hasDragged = true;\n beginDragVisuals(isResizing);\n }\n\n if (isResizing === \"left\") {\n applyDragWidth(\"left\", e.clientX);\n } else if (isResizing === \"right\") {\n applyDragWidth(\"right\", window.innerWidth - e.clientX);\n }\n };\n\n const handleToggleClick = (side: \"left\" | \"right\", e: MouseEvent) => {\n // Only toggle if we didn't drag\n if (hasDragged) {\n e.preventDefault();\n e.stopPropagation();\n // Reset the flag for next interaction\n hasDragged = false;\n return;\n }\n\n if (side === \"left\") {\n setIsSidebarCollapsed((prev) => !prev);\n } else {\n setIsRightSidebarCollapsed((prev) => !prev);\n }\n };\n\n onMount(() => {\n document.addEventListener(\"mousemove\", handleMouseMove);\n document.addEventListener(\"mouseup\", handleMouseUp);\n onCleanup(() => {\n document.removeEventListener(\"mousemove\", handleMouseMove);\n document.removeEventListener(\"mouseup\", handleMouseUp);\n // Reset body styles if component unmounts during drag\n if (isResizing) {\n endDrag();\n }\n });\n });\n\n return {\n handleMouseDown,\n handleToggleClick,\n };\n}\n", "import {\n createEffect,\n createSignal,\n onCleanup,\n type Accessor,\n} from \"solid-js\";\n\n/**\n * Tracks whether a `<patchwork-view>` provider has dispatched its\n * `patchwork:mounted` event yet, so callers can gate consumers that fire\n * `patchwork:request` events on the host listener being attached.\n *\n * The caller owns the element binding (typically a signal). Pass an accessor\n * that returns the current element; the effect re-runs whenever that element\n * changes and rewires the listener.\n */\nexport const useProviderReady = (\n componentId: string,\n element: Accessor<HTMLElement | undefined>\n): Accessor<boolean> => {\n const [isReady, setReady] = createSignal(false);\n\n createEffect(() => {\n const el = element();\n if (!el) return;\n setReady(false);\n const onMounted = (event: Event) => {\n const detail = (event as CustomEvent<{ componentId?: string }>).detail;\n if (detail?.componentId !== componentId) return;\n setReady(true);\n };\n el.addEventListener(\"patchwork:mounted\", onMounted);\n onCleanup(() => el.removeEventListener(\"patchwork:mounted\", onMounted));\n });\n\n return isReady;\n};\n", "import {\n createEffect,\n createSignal,\n onCleanup,\n type Accessor,\n} from \"solid-js\";\n\n// Safety net for the \"failed to mount\" case: a tool whose module throws sets\n// the view's internal state to \"error\" without dispatching any settling event,\n// so without this the sidebar would suspend forever. Long enough that a slow\n// (but healthy) load still wins the race and settles via its real event.\nconst MOUNT_TIMEOUT_MS = 5000;\n\n/**\n * Tracks whether the main document `<patchwork-view>` has settled *at least\n * once* \u2014 either it dispatched `patchwork:mounted` (a tool rendered) or\n * `patchwork:no-tool` (no tool could be resolved). Used to defer the sidebar\n * widgets until the main column has loaded, so the primary document wins the\n * initial render race.\n *\n * The result LATCHES: once true it stays true. We only want to win the *first*\n * render race \u2014 re-suspending on every later doc switch would tear down and\n * rebuild the widgets each time. So once settled we stop listening and never go\n * back to false.\n *\n * Both events bubble, so we listen on a stable container that wraps the view.\n * Events are filtered by url so a sidebar widget mounting inside the same\n * container can't settle us early.\n *\n * A timeout backs the explicit \"failed to mount\" case (see MOUNT_TIMEOUT_MS):\n * the view's error path emits no event, so without a fallback the widgets would\n * never appear.\n */\nexport const useMainDocMounted = (\n element: Accessor<HTMLElement | undefined>,\n docUrl: Accessor<string | undefined>\n): Accessor<boolean> => {\n const [isMounted, setMounted] = createSignal(false);\n\n createEffect(() => {\n // Latched: stop watching (and stop re-arming the timeout) once settled.\n if (isMounted()) return;\n const el = element();\n const url = docUrl();\n if (!el || !url) return;\n\n const onSettled = (event: Event) => {\n const detail = (event as CustomEvent<{ url?: string }>).detail;\n // `patchwork:mounted` for a doc view carries the url; ignore events for\n // other documents that happen to bubble through this container.\n if (detail?.url && detail.url !== url) return;\n setMounted(true);\n };\n\n el.addEventListener(\"patchwork:mounted\", onSettled);\n el.addEventListener(\"patchwork:no-tool\", onSettled);\n const timer = setTimeout(() => setMounted(true), MOUNT_TIMEOUT_MS);\n\n onCleanup(() => {\n el.removeEventListener(\"patchwork:mounted\", onSettled);\n el.removeEventListener(\"patchwork:no-tool\", onSettled);\n clearTimeout(timer);\n });\n });\n\n return isMounted;\n};\n", "import {\n getRegistry,\n type ToolDescription,\n} from \"@inkandswitch/patchwork-plugins\";\nimport { createMemo, createSignal, onCleanup, type Accessor } from \"solid-js\";\n\nexport type TaggedComponent = {\n id: string;\n name: string;\n icon?: string;\n};\n\n/**\n * Live, registry-driven list of every `patchwork:component` carrying `tag`\n * (e.g. `\"context-tool\"` or `\"system-tray\"`), sorted by name. A component just\n * declares its tag and shows up everywhere that tag is rendered.\n *\n * Reactive to the registry's `\"changed\"` event, so a late-registering or\n * hot-reloaded plugin appears without a remount. Safe to call from inside the\n * isolated iframe realm too \u2014 it mounts the same plugin set as the host (see\n * `registry.start` in `isolation/src/boot/iframe/main.ts`), so each realm\n * resolves its own local, equivalent list.\n */\nexport function useTaggedComponents(tag: string): Accessor<TaggedComponent[]> {\n const registry = getRegistry<ToolDescription>(\"patchwork:component\");\n\n const [version, setVersion] = createSignal(0);\n const off = registry.on(\"changed\", () => setVersion((v) => v + 1));\n onCleanup(off);\n\n return createMemo(() => {\n version();\n return (registry.all?.() ?? [])\n .filter((description) => (description.tags ?? []).includes(tag))\n .map((description) => ({\n id: description.id,\n name: description.name || description.id,\n icon: description.icon,\n }))\n .sort((a, b) => a.name.localeCompare(b.name));\n });\n}\n", "import { template as _$template } from \"solid-js/web\";\nimport { delegateEvents as _$delegateEvents } from \"solid-js/web\";\nimport { setStyleProperty as _$setStyleProperty } from \"solid-js/web\";\nimport { effect as _$effect } from \"solid-js/web\";\nimport { memo as _$memo } from \"solid-js/web\";\nimport { addEventListener as _$addEventListener } from \"solid-js/web\";\nimport { insert as _$insert } from \"solid-js/web\";\nvar _tmpl$ = /*#__PURE__*/_$template(`<div class=debug-registry-toast><div class=debug-registry-toast__header><span class=debug-registry-toast__title>\uD83D\uDD27 Registry (<!>)</span><button class=debug-registry-toast__clear title=\"Clear all\">\u2715</button></div><div class=debug-registry-toast__list>`),\n _tmpl$2 = /*#__PURE__*/_$template(`<div class=debug-registry-toast__item><div class=debug-registry-toast__content><span class=debug-registry-toast__event-type></span><span class=debug-registry-toast__plugin-type>`),\n _tmpl$3 = /*#__PURE__*/_$template(`<span class=debug-registry-toast__plugin-id>`);\nimport { createEffect, createSignal, onCleanup } from \"solid-js\";\nimport { getAllRegistries } from \"@inkandswitch/patchwork-plugins\";\nconst DEBUG_MODAL_KEY = \"debugModal\";\nexport function isDebugModalEnabled() {\n try {\n return localStorage.getItem(DEBUG_MODAL_KEY) === \"true\";\n } catch {\n return false;\n }\n}\nexport function setDebugModalEnabled(enabled) {\n try {\n if (enabled) {\n localStorage.setItem(DEBUG_MODAL_KEY, \"true\");\n } else {\n localStorage.removeItem(DEBUG_MODAL_KEY);\n }\n } catch {}\n}\nconst DEFAULT_EVENTS = [\"changed\"];\nexport function useDebugRegistryToast(options = {}) {\n const {\n events: subscribedEvents = DEFAULT_EVENTS\n } = options;\n const [events, setEvents] = createSignal([]);\n const [isEnabled, setIsEnabled] = createSignal(isDebugModalEnabled());\n const timeouts = /* @__PURE__ */new Set();\n const addEvent = (type, event, pluginId, pluginName) => {\n const newEvent = {\n id: crypto.randomUUID(),\n type,\n event,\n pluginId,\n pluginName,\n timestamp: Date.now()\n };\n setEvents(prev => {\n const updated = [newEvent, ...prev].slice(0, 50);\n return updated;\n });\n const timeoutId = setTimeout(() => {\n setEvents(prev => prev.filter(e => e.id !== newEvent.id));\n timeouts.delete(timeoutId);\n }, 5e3);\n timeouts.add(timeoutId);\n };\n const dismissEvent = eventId => {\n setEvents(prev => prev.filter(e => e.id !== eventId));\n };\n const clearAll = () => {\n setEvents([]);\n };\n createEffect(() => {\n if (!isEnabled()) {\n setEvents([]);\n timeouts.forEach(id => clearTimeout(id));\n timeouts.clear();\n return;\n }\n const registries = getAllRegistries();\n const unsubscribes = [];\n const lastPluginInfo = /* @__PURE__ */new Map();\n registries.forEach((registry, type) => {\n const trackRegistered = registry.on(\"registered\", plugin => {\n lastPluginInfo.set(type, {\n id: plugin.id,\n name: plugin.name,\n action: \"registered\"\n });\n if (subscribedEvents.includes(\"registered\")) {\n addEvent(type, \"registered\", plugin.id, plugin.name);\n }\n });\n unsubscribes.push(trackRegistered);\n const trackLoaded = registry.on(\"loaded\", plugin => {\n lastPluginInfo.set(type, {\n id: plugin.id,\n name: plugin.name,\n action: \"loaded\"\n });\n if (subscribedEvents.includes(\"loaded\")) {\n addEvent(type, \"loaded\", plugin.id, plugin.name);\n }\n });\n unsubscribes.push(trackLoaded);\n const trackRemoved = registry.on(\"removed\", id => {\n lastPluginInfo.set(type, {\n id,\n action: \"removed\"\n });\n if (subscribedEvents.includes(\"removed\")) {\n addEvent(type, \"removed\", id);\n }\n });\n unsubscribes.push(trackRemoved);\n if (subscribedEvents.includes(\"changed\")) {\n const unsub = registry.on(\"changed\", () => {\n const info = lastPluginInfo.get(type);\n addEvent(type, \"changed\", info?.id, info?.name);\n lastPluginInfo.delete(type);\n });\n unsubscribes.push(unsub);\n }\n });\n onCleanup(() => {\n unsubscribes.forEach(unsub => unsub());\n timeouts.forEach(id => clearTimeout(id));\n timeouts.clear();\n });\n });\n createEffect(() => {\n const handleStorageChange = e => {\n if (e.key === DEBUG_MODAL_KEY) {\n setIsEnabled(e.newValue === \"true\");\n }\n };\n window.addEventListener(\"storage\", handleStorageChange);\n onCleanup(() => window.removeEventListener(\"storage\", handleStorageChange));\n });\n return {\n events,\n isEnabled,\n setIsEnabled: enabled => {\n setDebugModalEnabled(enabled);\n setIsEnabled(enabled);\n },\n dismissEvent,\n clearAll\n };\n}\nexport function DebugRegistryToast({\n events,\n onDismiss,\n onClearAll\n}) {\n if (events.length === 0) return null;\n const eventColor = event => {\n switch (event) {\n case \"registered\":\n return \"var(--debug-toast-registered, #3b82f6)\";\n case \"loaded\":\n return \"var(--debug-toast-loaded, #22c55e)\";\n case \"removed\":\n return \"var(--debug-toast-removed, #ef4444)\";\n case \"changed\":\n return \"var(--debug-toast-changed, #f59e0b)\";\n }\n };\n return (() => {\n var _el$ = _tmpl$(),\n _el$2 = _el$.firstChild,\n _el$3 = _el$2.firstChild,\n _el$4 = _el$3.firstChild,\n _el$6 = _el$4.nextSibling,\n _el$5 = _el$6.nextSibling,\n _el$7 = _el$3.nextSibling,\n _el$8 = _el$2.nextSibling;\n _$insert(_el$3, () => events.length, _el$6);\n _$addEventListener(_el$7, \"click\", onClearAll, true);\n _$insert(_el$8, () => events.map(event => (() => {\n var _el$9 = _tmpl$2(),\n _el$0 = _el$9.firstChild,\n _el$1 = _el$0.firstChild,\n _el$10 = _el$1.nextSibling;\n _el$9.$$click = () => onDismiss(event.id);\n _$insert(_el$1, () => event.event);\n _$insert(_el$10, () => event.type);\n _$insert(_el$0, (() => {\n var _c$ = _$memo(() => !!event.pluginId);\n return () => _c$() && (() => {\n var _el$11 = _tmpl$3();\n _$insert(_el$11, () => event.pluginId);\n return _el$11;\n })();\n })(), null);\n _$effect(_$p => _$setStyleProperty(_el$9, \"border-left-color\", eventColor(event.event)));\n return _el$9;\n })()));\n return _el$;\n })();\n}\n_$delegateEvents([\"click\"]);", "import { template as _$template } from \"solid-js/web\";\nimport { delegateEvents as _$delegateEvents } from \"solid-js/web\";\nimport { getOwner as _$getOwner } from \"solid-js/web\";\nimport { effect as _$effect } from \"solid-js/web\";\nimport { setAttribute as _$setAttribute } from \"solid-js/web\";\nimport { memo as _$memo } from \"solid-js/web\";\nimport { insert as _$insert } from \"solid-js/web\";\nimport { createComponent as _$createComponent } from \"solid-js/web\";\nvar _tmpl$ = /*#__PURE__*/_$template(`<div class=threepane__title>`),\n _tmpl$2 = /*#__PURE__*/_$template(`<div class=threepane__doctitle-tools>`),\n _tmpl$3 = /*#__PURE__*/_$template(`<button type=button class=frame__sidebar-toggle title=\"Show context sidebar\"aria-label=\"Show context sidebar\">`),\n _tmpl$4 = /*#__PURE__*/_$template(`<div class=frame__topbar><div class=threepane__spacer>`),\n _tmpl$5 = /*#__PURE__*/_$template(`<patchwork-view>`, true, false, false);\nimport { For, Show } from \"solid-js\";\nimport { DocumentTitle } from \"./DocumentTitle\";\nimport { PanelRightIcon } from \"./ContextSidebar\";\nimport { slotId } from \"./SlotView\";\nexport function FrameTopBar(props) {\n const docToolSlots = () => props.toolSlots() ?? [];\n return (() => {\n var _el$ = _tmpl$4(),\n _el$3 = _el$.firstChild;\n _$insert(_el$, _$createComponent(Show, {\n get when() {\n return props.docUrl();\n },\n get children() {\n var _el$2 = _tmpl$();\n _$insert(_el$2, _$createComponent(DocumentTitle, {\n get docUrl() {\n return props.docUrl;\n }\n }));\n return _el$2;\n }\n }), _el$3);\n _$insert(_el$, _$createComponent(Show, {\n get when() {\n return _$memo(() => !!props.docUrl())() && docToolSlots().length;\n },\n get children() {\n var _el$4 = _tmpl$2();\n _$insert(_el$4, _$createComponent(For, {\n get each() {\n return docToolSlots();\n },\n children: slot => (() => {\n var _el$6 = _tmpl$5();\n _el$6._$owner = _$getOwner();\n _$effect(_p$ => {\n var _v$ = slotId(slot),\n _v$2 = props.docUrl();\n _v$ !== _p$.e && (_el$6.toolId = _p$.e = _v$);\n _v$2 !== _p$.t && (_el$6.docUrl = _p$.t = _v$2);\n return _p$;\n }, {\n e: undefined,\n t: undefined\n });\n return _el$6;\n })()\n }));\n return _el$4;\n }\n }), null);\n _$insert(_el$, _$createComponent(Show, {\n get when() {\n return _$memo(() => !!props.hasContext())() && props.isRightCollapsed();\n },\n get children() {\n var _el$5 = _tmpl$3();\n _el$5.$$click = () => props.onToggleRight();\n _$setAttribute(_el$5, \"aria-pressed\", false);\n _$insert(_el$5, _$createComponent(PanelRightIcon, {}));\n return _el$5;\n }\n }), null);\n _$effect(() => _el$.classList.toggle(\"frame__topbar--left-collapsed\", !!props.isLeftCollapsed()));\n return _el$;\n })();\n}\n_$delegateEvents([\"click\"]);", "import { template as _$template } from \"solid-js/web\";\nimport { delegateEvents as _$delegateEvents } from \"solid-js/web\";\nimport { setAttribute as _$setAttribute } from \"solid-js/web\";\nimport { insert as _$insert } from \"solid-js/web\";\nimport { memo as _$memo } from \"solid-js/web\";\nimport { effect as _$effect } from \"solid-js/web\";\nimport { use as _$use } from \"solid-js/web\";\nimport { createComponent as _$createComponent } from \"solid-js/web\";\nvar _tmpl$ = /*#__PURE__*/_$template(`<span class=threepane__title-text>`),\n _tmpl$2 = /*#__PURE__*/_$template(`<input class=threepane__title-input type=text>`);\nimport { useDocument } from \"solid-automerge\";\nimport { getType } from \"@inkandswitch/patchwork-filesystem\";\nimport { getRegistry, isLoadedPlugin } from \"@inkandswitch/patchwork-plugins\";\nimport { createEffect, createMemo, createSignal, onCleanup, onMount, Show } from \"solid-js\";\nexport function DocumentTitle(props) {\n let anchor;\n const [repo, setRepo] = createSignal();\n onMount(() => {\n setRepo(anchor.closest(\"repo-provider\")?.repo);\n });\n return _$createComponent(Show, {\n get when() {\n return repo();\n },\n get fallback() {\n return (() => {\n var _el$ = _tmpl$();\n var _ref$ = anchor;\n typeof _ref$ === \"function\" ? _$use(_ref$, _el$) : anchor = _el$;\n return _el$;\n })();\n },\n children: resolvedRepo => _$createComponent(DocumentTitleInner, {\n get docUrl() {\n return props.docUrl;\n },\n get repo() {\n return resolvedRepo();\n }\n })\n });\n}\nfunction DocumentTitleInner(props) {\n const [doc, handle] = useDocument(() => props.docUrl(), {\n repo: props.repo\n });\n const registry = getRegistry(\"patchwork:datatype\");\n const [registryVersion, setRegistryVersion] = createSignal(0);\n onMount(() => {\n const off = registry.on(\"changed\", () => setRegistryVersion(v => v + 1));\n onCleanup(off);\n });\n const typeId = createMemo(() => {\n const d = doc();\n return d ? getType(d) : void 0;\n });\n createEffect(() => {\n const id = typeId();\n if (id) void registry.load(id);\n });\n const datatype = createMemo(() => {\n registryVersion();\n const id = typeId();\n if (!id) return void 0;\n const dt = registry.get(id);\n return dt && isLoadedPlugin(dt) ? dt : void 0;\n });\n const title = createMemo(() => {\n const d = doc();\n const dt = datatype();\n if (!d || !dt) return void 0;\n return dt.module.getTitle(d);\n });\n const canEdit = createMemo(() => !!handle() && typeof datatype()?.module.setTitle === \"function\");\n const [editing, setEditing] = createSignal(false);\n let inputRef;\n function startEditing() {\n if (!canEdit()) return;\n setEditing(true);\n queueMicrotask(() => {\n inputRef?.focus();\n inputRef?.select();\n });\n }\n function commit(save) {\n if (!editing()) return;\n setEditing(false);\n if (!save) return;\n const next = inputRef?.value.trim();\n if (!next || next === title()) return;\n const h = handle();\n const setTitle = datatype()?.module.setTitle;\n if (!h || !setTitle) return;\n h.change(d => {\n setTitle(d, next);\n const meta = d[\"@patchwork\"];\n if (meta) meta.title = next;\n });\n }\n return _$createComponent(Show, {\n get when() {\n return editing();\n },\n get fallback() {\n return (() => {\n var _el$3 = _tmpl$();\n _el$3.$$click = startEditing;\n _$insert(_el$3, () => title() ?? \"Untitled\");\n _$effect(_p$ => {\n var _v$ = !!canEdit(),\n _v$2 = canEdit() ? \"Rename\" : void 0;\n _v$ !== _p$.e && _el$3.classList.toggle(\"threepane__title-text--editable\", _p$.e = _v$);\n _v$2 !== _p$.t && _$setAttribute(_el$3, \"title\", _p$.t = _v$2);\n return _p$;\n }, {\n e: undefined,\n t: undefined\n });\n return _el$3;\n })();\n },\n get children() {\n var _el$2 = _tmpl$2();\n _el$2.$$keydown = e => {\n if (e.key === \"Enter\") {\n e.preventDefault();\n commit(true);\n } else if (e.key === \"Escape\") {\n e.preventDefault();\n commit(false);\n }\n };\n _el$2.addEventListener(\"blur\", () => commit(true));\n var _ref$2 = inputRef;\n typeof _ref$2 === \"function\" ? _$use(_ref$2, _el$2) : inputRef = _el$2;\n _$effect(() => _el$2.value = title() ?? \"\");\n return _el$2;\n }\n });\n}\n_$delegateEvents([\"keydown\", \"click\"]);", "// cabbages.ts\nimport debug from \"debug\";\nvar log = debug(\"cabbages\");\nfunction pojo(target) {\n return typeof target == \"object\" && typeof target != null && Object.getPrototypeOf(target) == Object.prototype;\n}\nvar BLOCK_MARKER = \"\\uFFFC\";\nfunction apply(target, ...rest) {\n if (rest.length == 0) {\n log(\"empty patch\");\n return;\n }\n const [path, range, val] = rest;\n let p = [...path];\n while (true) {\n let key = p.shift();\n if (!p.length) {\n const RANGE_ARRAY = Array.isArray(range);\n if (pojo(target) && RANGE_ARRAY && typeof key == \"undefined\" && typeof range[0] == \"string\") {\n delete target[range[0]];\n return;\n }\n if (RANGE_ARRAY || typeof range == \"number\") {\n if (typeof key == \"undefined\") {\n throw new Error(\"cant treat top level as a seq\");\n }\n key = key;\n let [start, end] = Array.isArray(range) ? range : [range, range + 1];\n const ZERO_LENGTH = Array.isArray(range) && range.length == 0;\n if (!ZERO_LENGTH && (start == null || end == null)) {\n throw new RangeError(\"it's all or nothing, no half measures\");\n }\n const DELETE = typeof val == \"undefined\";\n const INSERT = start === end && !DELETE;\n const APPEND = ZERO_LENGTH && !DELETE;\n const REPLACE = !INSERT && !DELETE && !APPEND;\n if (typeof target[key] == \"undefined\") {\n if (typeof target == \"string\") {\n return;\n } else if (typeof val == \"string\") {\n target[key] = \"\";\n } else {\n target[key] = [];\n }\n }\n let seq = target[key];\n if (Array.isArray(seq)) {\n if (APPEND) {\n Array.isArray(val) ? seq.push(...val) : seq.push(val);\n return;\n }\n if (INSERT || REPLACE) {\n Array.isArray(val) ? seq.splice(start, end - start, ...val) : seq.splice(start, end - start, val);\n return;\n }\n if (DELETE) {\n seq.splice(start, end - start);\n return;\n }\n throw new Error(\"i don't know what happened\");\n }\n if (typeof seq == \"string\") {\n if (APPEND) {\n target[key] = seq + val;\n return;\n }\n if (REPLACE || INSERT) {\n target[key] = seq.slice(0, start) + (typeof val == \"string\" ? val : val.map(\n (n) => typeof n == \"string\" ? n : BLOCK_MARKER\n ).join(\"\")) + seq.slice(end);\n return;\n }\n if (DELETE) {\n target[key] = seq.slice(0, start) + seq.slice(end);\n return;\n }\n throw new Error(\"i don't know what happened\");\n }\n if (pojo(seq) && RANGE_ARRAY && typeof range[0] == \"string\") {\n delete seq[range[0]];\n return;\n }\n throw new Error(\"not implemented\");\n }\n if (typeof key == \"undefined\") {\n if (typeof range != \"string\") {\n throw new Error(`can't index top-level map with ${range}`);\n }\n if (typeof val == \"undefined\") {\n delete target[range];\n } else {\n target[range] = val;\n }\n return;\n }\n if (typeof target[key] == \"undefined\") {\n target[key] = {};\n }\n if (RANGE_ARRAY) {\n let [a, b] = range;\n if (a != null && b != null) {\n if (typeof val == \"undefined\" && a != null && b != null) {\n delete target[key][a || b];\n } else {\n target[key][a || b] = val;\n }\n }\n } else {\n if (typeof val == \"undefined\") {\n delete target[key][range];\n } else if (typeof target[key] == \"string\") {\n return;\n } else {\n target[key][range] = val;\n }\n }\n return;\n }\n if (typeof key == \"undefined\") {\n throw new Error(\"cant treat top level as a seq\");\n }\n key = key;\n let nextkey = p[0];\n if (typeof target[key] == \"undefined\") {\n if (typeof nextkey == \"string\") {\n target[key] = {};\n } else if (typeof nextkey == \"number\") {\n target[key] = [];\n } else {\n throw new Error(`can't go down this road ${target}.${key}.${nextkey}`);\n }\n }\n target = target[key];\n }\n}\nvar patch = apply;\nfunction get(obj, key) {\n for (let p = 0; p < key.length; p++) {\n obj = obj ? obj[key[p]] : void 0;\n }\n return obj;\n}\nfunction fromAutomerge(autopatch, payload) {\n const path = autopatch.path.slice(0, -1);\n const key = autopatch.path[autopatch.path.length - 1];\n switch (autopatch.action) {\n case \"mark\":\n case \"unmark\":\n log(\n `skipping ${autopatch.action} because it doesn't affect material reality`\n );\n return [];\n case \"inc\":\n if (payload) {\n return [path, key, get(payload.patchInfo.after, autopatch.path)];\n } else {\n throw new Error(\n `can't apply ${autopatch.action} without payload argument`\n );\n }\n case \"conflict\":\n if (payload) {\n return [path, key, get(payload.patchInfo.after, autopatch.path)];\n } else {\n throw new Error(\n `can't apply ${autopatch.action} without payload argument`\n );\n }\n case \"del\": {\n return typeof key == \"string\" ? [path, key] : [path, [key, key + (autopatch.length || 1)]];\n }\n case \"insert\": {\n return [\n path,\n [key, key],\n structuredClone(autopatch.values)\n ];\n }\n case \"splice\": {\n return [path, [key, key], [autopatch.value]];\n }\n case \"put\": {\n return [path, key, structuredClone(autopatch.value)];\n }\n }\n}\nexport {\n apply,\n fromAutomerge,\n patch,\n pojo\n};\n", "import type {DocHandleChangePayload} from \"@automerge/automerge-repo/slim\"\nimport {apply, fromAutomerge} from \"cabbages\"\n\n/**\n * convert automerge patches to solid producer operations\n * @param payload the\n * [DocHandleChangePayload](https://automerge.org/automerge-repo/interfaces/_automerge_automerge_repo.DocHandleChangePayload.html)\n * from the handle.on(\"change\n * @returns a callback for an immer-like function. e.g.\n * [produce](https://docs.solidjs.com/reference/store-utilities/produce) for\n * [Solid\n * Stores](https://docs.solidjs.com/reference/store-utilities/create-store)\n */\nexport default function autoproduce<T>(\n\tpayload: DocHandleChangePayload<T>\n): (doc: T) => void {\n\treturn (doc: T) => {\n\t\tfor (let patch of payload.patches) {\n\t\t\tapply(doc, ...fromAutomerge(patch, payload))\n\t\t}\n\t}\n}\n", "import {createMemo, type Accessor} from \"solid-js\"\nimport {type DocHandle, type Doc} from \"@automerge/automerge-repo/slim\"\nimport makeDocumentProjection from \"./makeDocumentProjection.ts\"\nimport {access} from \"@solid-primitives/utils\"\n\n/**\n * get a fine-grained live view of a document from a handle. works with\n * {@link useDocHandle}.\n * @param handle an accessor (signal/resource) of a\n * [DocHandle](https://automerge.org/automerge-repo/classes/_automerge_automerge_repo.DocHandle.html)\n */\nexport default function createDocumentProjection<T extends object>(\n\thandle: Accessor<DocHandle<T> | undefined>\n): Accessor<Doc<T> | undefined> {\n\tconst projection = createMemo<Doc<T> | undefined>(\n\t\t() => access(handle) && makeDocumentProjection<T>(access(handle)!)\n\t)\n\treturn projection\n}\n", "import {onCleanup} from \"solid-js\"\nimport type {\n\tDoc,\n\tDocHandle,\n\tDocHandleChangePayload,\n} from \"@automerge/automerge-repo/slim\"\nimport autoproduce from \"./autoproduce.ts\"\nimport {createStore, produce, reconcile, type Store} from \"solid-js/store\"\n\nconst cache = new WeakMap<\n\tDocHandle<unknown>,\n\t{\n\t\trefs: number\n\t\tstore: Store<Doc<unknown>>\n\t\tcleanup(): void\n\t}\n>()\n\n/**\n * make a fine-grained live view of a document from its handle.\n * @param handle an Automerge\n * [DocHandle](https://automerge.org/automerge-repo/classes/_automerge_automerge_repo.DocHandle.html)\n */\nexport default function makeDocumentProjection<T extends object>(\n\thandle: DocHandle<T>\n): Doc<T> {\n\tonCleanup(() => {\n\t\tconst item = cache.get(handle)!\n\t\tif (!item) return\n\t\tif (!item.refs--) {\n\t\t\titem.cleanup()\n\t\t}\n\t})\n\n\tif (cache.has(handle)) {\n\t\tconst item = cache.get(handle)!\n\t\titem.refs++\n\t\treturn item.store as Doc<T>\n\t}\n\n\tconst [doc, set] = createStore<Doc<T>>(structuredClone(handle.doc()!))\n\n\tcache.set(handle, {\n\t\trefs: 0,\n\t\tstore: doc,\n\t\tcleanup() {\n\t\t\thandle.off(\"change\", patch)\n\t\t\thandle.off(\"delete\", ondelete)\n\t\t\tcache.delete(handle)\n\t\t},\n\t})\n\n\tfunction patch(payload: DocHandleChangePayload<T>) {\n\t\t// `scopeReplaced` means the change landed at or above this (sub-)handle's\n\t\t// scope boundary, so it can't be expressed as in-scope patches. The\n\t\t// payload still carries `doc` \u2014 the new value at the handle's path (the\n\t\t// part of the store this scope points at) \u2014 so we reconcile against that\n\t\t// instead of applying patches. `reconcile` structurally diffs it against\n\t\t// the current store, so unchanged subtrees keep their identity and only\n\t\t// the parts that actually changed notify. `doc` is undefined when the\n\t\t// scope was removed entirely.\n\t\tif (payload.scopeReplaced) {\n\t\t\tset(reconcile((payload.doc ?? {}) as Doc<T>))\n\t\t\treturn\n\t\t}\n\t\tset(produce(autoproduce(payload)))\n\t}\n\n\tfunction ondelete() {\n\t\tset(reconcile({} as Doc<T>))\n\t}\n\n\thandle.on(\"change\", patch)\n\thandle.on(\"delete\", ondelete)\n\n\thandle.whenReady().then(() => {\n\t\tset(structuredClone(handle.doc()!))\n\t})\n\n\treturn doc\n}\n", "import { getOwner, onCleanup, createSignal, untrack, sharedConfig, onMount, DEV, equalFn, } from \"solid-js\";\nimport { isServer } from \"solid-js/web\";\nexport * from \"./types.js\";\n//\n// GENERAL HELPERS:\n//\nexport { isServer };\nexport const isClient = !isServer;\nexport const isDev = isClient && !!DEV;\nexport const isProd = !isDev;\n/** no operation */\nexport const noop = (() => void 0);\nexport const trueFn = () => true;\nexport const falseFn = () => false;\n/** @deprecated use {@link equalFn} from \"solid-js\" */\nexport const defaultEquals = equalFn;\nexport const EQUALS_FALSE_OPTIONS = { equals: false };\nexport const INTERNAL_OPTIONS = { internal: true };\n/**\n * Check if the value is an instance of ___\n */\nexport const ofClass = (v, c) => v instanceof c || (v && v.constructor === c);\n/** Check if value is typeof \"object\" or \"function\" */\nexport function isObject(value) {\n return value !== null && (typeof value === \"object\" || typeof value === \"function\");\n}\nexport const isNonNullable = (i) => i != null;\nexport const filterNonNullable = (arr) => arr.filter(isNonNullable);\nexport const compare = (a, b) => (a < b ? -1 : a > b ? 1 : 0);\n/**\n * Check shallow array equality\n */\nexport const arrayEquals = (a, b) => a === b || (a.length === b.length && a.every((e, i) => e === b[i]));\n/**\n * Returns a function that will call all functions in the order they were chained with the same arguments.\n */\nexport function chain(callbacks) {\n return (...args) => {\n for (const callback of callbacks)\n callback && callback(...args);\n };\n}\n/**\n * Returns a function that will call all functions in the reversed order with the same arguments.\n */\nexport function reverseChain(callbacks) {\n return (...args) => {\n for (let i = callbacks.length - 1; i >= 0; i--) {\n const callback = callbacks[i];\n callback && callback(...args);\n }\n };\n}\nexport const clamp = (n, min, max) => Math.min(Math.max(n, min), max);\n/**\n * Accesses the value of a MaybeAccessor\n * @example\n * ```ts\n * access(\"foo\") // => \"foo\"\n * access(() => \"foo\") // => \"foo\"\n * ```\n */\nexport const access = (v) => typeof v === \"function\" && !v.length ? v() : v;\nexport const asArray = (value) => Array.isArray(value) ? value : value ? [value] : [];\n/**\n * Access an array of MaybeAccessors\n * @example\n * const list = [1, 2, () => 3)] // T: MaybeAccessor<number>[]\n * const newList = accessArray(list) // T: number[]\n */\nexport const accessArray = (list) => list.map(v => access(v));\n/**\n * Run the function if the accessed value is not `undefined` nor `null`\n * @param value\n * @param fn\n */\nexport const withAccess = (value, fn) => {\n const _value = access(value);\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n typeof _value != null && fn(_value);\n};\nexport const asAccessor = (v) => (typeof v === \"function\" ? v : () => v);\n/** If value is a function \u2013 call it with a given arguments \u2013 otherwise get the value as is */\nexport function accessWith(valueOrFn, ...args) {\n return typeof valueOrFn === \"function\" ? valueOrFn(...args) : valueOrFn;\n}\nexport function defer(deps, fn, initialValue) {\n const isArray = Array.isArray(deps);\n let prevInput;\n let shouldDefer = true;\n return prevValue => {\n let input;\n if (isArray) {\n input = Array(deps.length);\n for (let i = 0; i < deps.length; i++)\n input[i] = deps[i]();\n }\n else\n input = deps();\n if (shouldDefer) {\n shouldDefer = false;\n prevInput = input;\n return initialValue;\n }\n const result = untrack(() => fn(input, prevInput, prevValue));\n prevInput = input;\n return result;\n };\n}\n/**\n * Get entries of an object\n */\nexport const entries = Object.entries;\n/**\n * Get keys of an object\n */\nexport const keys = Object.keys;\n/**\n * Solid's `onCleanup` that doesn't warn in development if used outside of a component.\n */\nexport const tryOnCleanup = isDev\n ? fn => (getOwner() ? onCleanup(fn) : fn)\n : onCleanup;\nexport const createCallbackStack = () => {\n let stack = [];\n const clear = () => (stack = []);\n return {\n push: (...callbacks) => stack.push(...callbacks),\n execute(arg0, arg1, arg2, arg3) {\n stack.forEach(cb => cb(arg0, arg1, arg2, arg3));\n clear();\n },\n clear,\n };\n};\n/**\n * Group synchronous function calls.\n * @param fn\n * @returns `fn`\n */\nexport function createMicrotask(fn) {\n let calls = 0;\n let args;\n onCleanup(() => (calls = 0));\n return (...a) => {\n (args = a), calls++;\n queueMicrotask(() => --calls === 0 && fn(...args));\n };\n}\n/**\n * A hydratable version of the {@link createSignal}. It will use the serverValue on the server and the update function on the client. If initialized during hydration it will use serverValue as the initial value and update it once hydration is complete.\n *\n * @param serverValue initial value of the state on the server\n * @param update called once on the client or on hydration to initialize the value\n * @param options {@link SignalOptions}\n * @returns\n * ```ts\n * [state: Accessor<T>, setState: Setter<T>]\n * ```\n * @see {@link createSignal}\n */\nexport function createHydratableSignal(serverValue, update, options) {\n if (isServer) {\n return createSignal(serverValue, options);\n }\n if (sharedConfig.context) {\n const [state, setState] = createSignal(serverValue, options);\n onMount(() => setState(() => update()));\n return [state, setState];\n }\n return createSignal(update(), options);\n}\n/** @deprecated use {@link createHydratableSignal} instead */\nexport const createHydrateSignal = createHydratableSignal;\n/**\n * Handle items removed and added to the array by diffing it by refference.\n *\n * @param current new array instance\n * @param prev previous array copy\n * @param handleAdded called once for every added item to array\n * @param handleRemoved called once for every removed from array\n */\nexport function handleDiffArray(current, prev, handleAdded, handleRemoved) {\n const currLength = current.length;\n const prevLength = prev.length;\n let i = 0;\n if (!prevLength) {\n for (; i < currLength; i++)\n handleAdded(current[i]);\n return;\n }\n if (!currLength) {\n for (; i < prevLength; i++)\n handleRemoved(prev[i]);\n return;\n }\n for (; i < prevLength; i++) {\n if (prev[i] !== current[i])\n break;\n }\n let prevEl;\n let currEl;\n prev = prev.slice(i);\n current = current.slice(i);\n for (prevEl of prev) {\n if (!current.includes(prevEl))\n handleRemoved(prevEl);\n }\n for (currEl of current) {\n if (!prev.includes(currEl))\n handleAdded(currEl);\n }\n}\n// \u2500\u2500\u2500 String transforms \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n/**\n * Parse a string as a single JSON value.\n *\n * ```ts\n * const { data } = createSSE<{ status: string }>(url, { transform: json });\n * ```\n */\nexport const json = (raw) => JSON.parse(raw);\n/**\n * Parse a string as newline-delimited JSON (NDJSON / JSON Lines).\n *\n * Each non-empty line is parsed as a separate JSON value and returned as an array.\n *\n * ```ts\n * const { data } = createSSE<TickEvent[]>(url, { transform: ndjson });\n * // data() === [{ id: 1, type: \"tick\" }, { id: 2, type: \"tick\" }]\n * ```\n */\nexport const ndjson = (raw) => raw\n .split(\"\\n\")\n .filter(line => line !== \"\")\n .map(line => JSON.parse(line));\n/**\n * Split a string into individual lines, returning a `string[]`. Empty lines are filtered out.\n *\n * ```ts\n * const { data } = createSSE<string[]>(url, { transform: lines });\n * // data() === [\"line one\", \"line two\"]\n * ```\n */\nexport const lines = (raw) => raw.split(\"\\n\").filter(line => line !== \"\");\n/**\n * Parse a string as a number using `Number()` semantics.\n *\n * Note: `\"\"` \u2192 `0`, non-numeric strings \u2192 `NaN`.\n *\n * ```ts\n * const { data } = createSSE<number>(url, { transform: number });\n * // data() === 42\n * ```\n */\nexport const number = (raw) => Number(raw);\nexport function safe(transform, fallback) {\n return (raw) => {\n try {\n return transform(raw);\n }\n catch {\n return fallback;\n }\n };\n}\n/**\n * Compose two transforms into one: the output of `a` is passed as the input of `b`.\n *\n * ```ts\n * const { data } = createSSE<RawEvent[]>(url, {\n * transform: pipe(ndjson<RawEvent>, rows => rows.filter(r => r.type === \"tick\")),\n * });\n * ```\n */\nexport function pipe(a, b) {\n return (raw) => b(a(raw));\n}\n", "import type {AutomergeUrl, DocHandle} from \"@automerge/automerge-repo/slim\"\nimport {createEffect, createResource, useContext, type Resource} from \"solid-js\"\nimport {access, type MaybeAccessor} from \"@solid-primitives/utils\"\nimport {RepoContext} from \"./context.ts\"\nimport type {UseDocHandleOptions} from \"./types.ts\"\n\n/**\n * get a\n * [DocHandle](https://automerge.org/automerge-repo/classes/_automerge_automerge_repo.DocHandle.html)\n * from an\n * [AutomergeUrl](https://automerge.org/automerge-repo/types/_automerge_automerge_repo.AutomergeUrl.html)\n * as a\n * [Resource](https://docs.solidjs.com/reference/basic-reactivity/create-resource).\n * Waits for the handle to be ready.\n */\nexport default function useDocHandle<T>(\n\turl: MaybeAccessor<AutomergeUrl | undefined>,\n\toptions?: UseDocHandleOptions\n): Resource<DocHandle<T> | undefined> {\n\tconst contextRepo = useContext(RepoContext)\n\n\tif (!options?.repo && !contextRepo) {\n\t\tthrow new Error(\"use outside <RepoContext> requires options.repo\")\n\t}\n\n\tconst repo = (options?.repo || contextRepo)!\n\n\tfunction getExistingHandle() {\n\t\tif (options?.[\"~skipInitialValue\"]) return undefined\n\t\tconst unwrappedURL = access(url)\n\t\tif (!unwrappedURL) return undefined\n\t\tconst state = repo.findWithProgress<T>(unwrappedURL).peek()\n\t\treturn state.state === \"ready\" ? state.handle : undefined\n\t}\n\n\tconst [handle, {mutate}] = createResource(\n\t\turl,\n\t\turl => repo.findWithProgress<T>(url).whenReady(),\n\t\t{\n\t\t\tinitialValue: getExistingHandle(),\n\t\t}\n\t)\n\n\tcreateEffect(() => {\n\t\tif (!access(url)) {\n\t\t\tmutate()\n\t\t}\n\t})\n\n\treturn handle\n}\n", "import type {Repo} from \"@automerge/automerge-repo/slim\"\nimport {createContext, type Context} from \"solid-js\"\n\n/**\n * a [context](https://docs.solidjs.com/concepts/context) that provides access\n * to an Automerge Repo. you don't need this, you can pass the repo in the\n * second arg to the functions that need it.\n */\nexport const RepoContext: Context<Repo | null> = createContext<Repo | null>(\n\tnull\n)\n", "import type {AutomergeUrl, Doc, DocHandle} from \"@automerge/automerge-repo/slim\"\nimport createDocumentProjection from \"./createDocumentProjection.ts\"\nimport type {MaybeAccessor} from \"@solid-primitives/utils\"\nimport useDocHandle from \"./useDocHandle.ts\"\nimport type {UseDocHandleOptions} from \"./types.ts\"\nimport type {Accessor, Resource} from \"solid-js\"\n\n/**\n * get a fine-grained live view of a document, and its handle, from a URL.\n * @param url a function that returns a url\n */\nexport default function useDocument<T extends object>(\n\turl: MaybeAccessor<AutomergeUrl | undefined>,\n\toptions?: UseDocHandleOptions\n): [Accessor<Doc<T> | undefined>, Resource<DocHandle<T> | undefined>] {\n\tconst handle = useDocHandle<T>(url, options)\n\treturn [createDocumentProjection<T>(handle), handle] as const\n}\n", "import {onCleanup, type Accessor} from \"solid-js\"\nimport {createSignal} from \"solid-js\"\nimport type {Doc, DocHandle} from \"@automerge/automerge-repo/slim\"\n\n/**\n * a light coarse-grained primitive when you care only _that_ a doc has changed,\n * and not _how_.\n * @param handle an Automerge\n * [DocHandle](https://automerge.org/automerge-repo/classes/_automerge_automerge_repo.DocHandle.html)\n */\nexport default function makeDocSignal<T extends object>(\n\thandle: DocHandle<T>\n): Accessor<Doc<T> | undefined> {\n\tconst [signal, setSignal] = createSignal<Doc<T> | undefined>(handle.doc())\n\n\tfunction update() {\n\t\tsetSignal(() => handle.doc() as Doc<T> | undefined)\n\t}\n\n\thandle.on(\"change\", update)\n\tonCleanup(() => handle.off(\"change\", update))\n\n\treturn signal\n}\n", "import {createEffect, onCleanup, type Accessor} from \"solid-js\"\nimport {createSignal} from \"solid-js\"\nimport type {Doc, DocHandle} from \"@automerge/automerge-repo/slim\"\n\n/**\n * a light coarse-grained primitive when you care only _that_ a doc has changed,\n * and not _how_. works with {@link useDocHandle}.\n * @param handle an accessor (signal/resource) of a\n * [DocHandle](https://automerge.org/automerge-repo/classes/_automerge_automerge_repo.DocHandle.html)\n */\nexport default function createDocSignal<T extends object>(\n\thandle: Accessor<DocHandle<T> | undefined>\n): Accessor<Doc<T> | undefined> {\n\tconst [signal, setSignal] = createSignal<Doc<T> | undefined>(handle()?.doc())\n\n\tcreateEffect(() => {\n\t\tconst h = handle()\n\n\t\tfunction update() {\n\t\t\tsetSignal(() => h?.doc() as Doc<T> | undefined)\n\t\t}\n\n\t\t// sync the signal with the current handle's doc\n\t\tupdate()\n\n\t\tif (h) {\n\t\t\th.on(\"change\", update)\n\t\t\tonCleanup(() => h.off(\"change\", update))\n\t\t}\n\t})\n\n\treturn signal\n}\n", "import type {Repo} from \"@automerge/automerge-repo/slim\"\nimport {RepoContext} from \"./context.ts\"\nimport {useContext} from \"solid-js\"\n\n/** grab the repo from the {@link RepoContext} */\nexport default function useRepo(): Repo {\n\tconst repo = useContext(RepoContext)\n\tif (!repo) throw new Error(\"Please wrap me in a <RepoContext value={repo}>\")\n\treturn repo\n}\n", "import { template as _$template } from \"solid-js/web\";\nimport { delegateEvents as _$delegateEvents } from \"solid-js/web\";\nimport { getOwner as _$getOwner } from \"solid-js/web\";\nimport { insert as _$insert } from \"solid-js/web\";\nimport { createComponent as _$createComponent } from \"solid-js/web\";\nvar _tmpl$ = /*#__PURE__*/_$template(`<div class=context-sidebar__tabs><button type=button class=context-sidebar__close title=\"Hide context sidebar\"aria-label=\"Hide context sidebar\">`),\n _tmpl$2 = /*#__PURE__*/_$template(`<div class=context-sidebar__content>`),\n _tmpl$3 = /*#__PURE__*/_$template(`<div class=context-sidebar>`),\n _tmpl$4 = /*#__PURE__*/_$template(`<patchwork-view>`, true, false, false),\n _tmpl$5 = /*#__PURE__*/_$template(`<svg xmlns=http://www.w3.org/2000/svg width=18 height=18 viewBox=\"0 0 24 24\"fill=none stroke=var(--studio-chrome-line) stroke-width=1.75 stroke-linecap=round stroke-linejoin=round><rect width=18 height=18 x=3 y=3 rx=2></rect><path d=\"M15 3v18\">`);\nimport { Show } from \"solid-js\";\nimport { useTaggedComponents } from \"../hooks\";\nimport { Sidebar } from \"./Sidebar\";\nimport { ContextTabs } from \"./ContextTabs\";\nexport function ContextSidebar(props) {\n const items = useTaggedComponents(\"context-tool\");\n const activeToolId = () => {\n const ids = items().map(item => item.id);\n const selected = props.selectedToolId();\n return selected && ids.includes(selected) ? selected : ids[0];\n };\n return _$createComponent(Sidebar, {\n side: \"right\",\n get isCollapsed() {\n return props.isCollapsed;\n },\n get width() {\n return props.width;\n },\n get onMouseDown() {\n return props.onMouseDown;\n },\n get onToggleClick() {\n return props.onToggleClick;\n },\n get canExpand() {\n return props.canExpand;\n },\n get children() {\n var _el$ = _tmpl$3();\n _$insert(_el$, _$createComponent(Show, {\n get when() {\n return items().length;\n },\n get children() {\n var _el$2 = _tmpl$(),\n _el$3 = _el$2.firstChild;\n _$insert(_el$2, _$createComponent(ContextTabs, {\n items: items,\n get selectedToolId() {\n return props.selectedToolId;\n },\n get setSelectedToolId() {\n return props.setSelectedToolId;\n }\n }), _el$3);\n _el$3.$$click = () => props.onCollapse();\n _$insert(_el$3, _$createComponent(PanelRightIcon, {}));\n return _el$2;\n }\n }), null);\n _$insert(_el$, _$createComponent(Show, {\n get when() {\n return !props.isCollapsed();\n },\n get children() {\n var _el$4 = _tmpl$2();\n _$insert(_el$4, _$createComponent(Show, {\n get when() {\n return activeToolId();\n },\n keyed: true,\n children: id => (() => {\n var _el$5 = _tmpl$4();\n _el$5.component = id;\n _el$5._$owner = _$getOwner();\n return _el$5;\n })()\n }));\n return _el$4;\n }\n }), null);\n return _el$;\n }\n });\n}\nexport function PanelRightIcon() {\n return _tmpl$5();\n}\n_$delegateEvents([\"click\"]);", "import { template as _$template } from \"solid-js/web\";\nimport { delegateEvents as _$delegateEvents } from \"solid-js/web\";\nimport { setStyleProperty as _$setStyleProperty } from \"solid-js/web\";\nimport { setAttribute as _$setAttribute } from \"solid-js/web\";\nimport { insert as _$insert } from \"solid-js/web\";\nimport { memo as _$memo } from \"solid-js/web\";\nimport { effect as _$effect } from \"solid-js/web\";\nimport { getOwner as _$getOwner } from \"solid-js/web\";\nvar _tmpl$ = /*#__PURE__*/_$template(`<patchwork-view>`, true, false, false),\n _tmpl$2 = /*#__PURE__*/_$template(`<div class=sidebar>`),\n _tmpl$3 = /*#__PURE__*/_$template(`<button class=\"sidebar-toggle sidebar-toggle--resizable\"aria-label=\"Toggle or resize sidebar\"title=\"Click to toggle, drag to resize\">`),\n _tmpl$4 = /*#__PURE__*/_$template(`<button class=\"sidebar-toggle sidebar-toggle--resizable\"aria-label=\"Expand sidebar\"title=\"Click to expand, drag to resize\">`);\nexport function Sidebar(props) {\n const widthStyle = () => `${props.isCollapsed() ? 0 : props.width()}px`;\n const content = () => {\n if (props.children !== void 0) return props.children;\n if (props.toolId && props.docUrl) {\n return (() => {\n var _el$ = _tmpl$();\n _el$._$owner = _$getOwner();\n _$effect(_p$ => {\n var _v$ = props.docUrl,\n _v$2 = props.toolId;\n _v$ !== _p$.e && (_el$.docUrl = _p$.e = _v$);\n _v$2 !== _p$.t && (_el$.toolId = _p$.t = _v$2);\n return _p$;\n }, {\n e: undefined,\n t: undefined\n });\n return _el$;\n })();\n }\n return null;\n };\n const canExpand = () => props.canExpand?.() ?? true;\n return (() => {\n var _el$2 = _tmpl$2();\n _$insert(_el$2, (() => {\n var _c$ = _$memo(() => !!(props.side === \"left\" && !props.isCollapsed()));\n return () => _c$() && content();\n })(), null);\n _$insert(_el$2, (() => {\n var _c$2 = _$memo(() => !!(props.side === \"left\" && !props.isCollapsed()));\n return () => _c$2() && (() => {\n var _el$3 = _tmpl$3();\n _el$3.$$mousedown = e => props.onMouseDown(props.side, e);\n _el$3.$$click = e => props.onToggleClick(props.side, e);\n return _el$3;\n })();\n })(), null);\n _$insert(_el$2, (() => {\n var _c$3 = _$memo(() => !!(props.side === \"left\" && props.isCollapsed() && canExpand()));\n return () => _c$3() && (() => {\n var _el$4 = _tmpl$4();\n _el$4.$$mousedown = e => props.onMouseDown(props.side, e);\n _el$4.$$click = e => props.onToggleClick(props.side, e);\n return _el$4;\n })();\n })(), null);\n _$insert(_el$2, (() => {\n var _c$4 = _$memo(() => !!(props.side === \"right\" && !props.isCollapsed()));\n return () => _c$4() && (() => {\n var _el$5 = _tmpl$3();\n _el$5.$$mousedown = e => props.onMouseDown(props.side, e);\n _el$5.$$click = e => props.onToggleClick(props.side, e);\n return _el$5;\n })();\n })(), null);\n _$insert(_el$2, (() => {\n var _c$5 = _$memo(() => !!(props.side === \"right\" && props.isCollapsed() && canExpand()));\n return () => _c$5() && (() => {\n var _el$6 = _tmpl$4();\n _el$6.$$mousedown = e => props.onMouseDown(props.side, e);\n _el$6.$$click = e => props.onToggleClick(props.side, e);\n return _el$6;\n })();\n })(), null);\n _$insert(_el$2, (() => {\n var _c$6 = _$memo(() => !!(props.side === \"right\" && !props.isCollapsed()));\n return () => _c$6() && content();\n })(), null);\n _$effect(_p$ => {\n var _v$3 = props.side,\n _v$4 = props.isCollapsed() ? \"\" : void 0,\n _v$5 = widthStyle();\n _v$3 !== _p$.e && _$setAttribute(_el$2, \"data-side\", _p$.e = _v$3);\n _v$4 !== _p$.t && _$setAttribute(_el$2, \"data-collapsed\", _p$.t = _v$4);\n _v$5 !== _p$.a && _$setStyleProperty(_el$2, \"width\", _p$.a = _v$5);\n return _p$;\n }, {\n e: undefined,\n t: undefined,\n a: undefined\n });\n return _el$2;\n })();\n}\n_$delegateEvents([\"click\", \"mousedown\"]);", "import { template as _$template } from \"solid-js/web\";\nimport { delegateEvents as _$delegateEvents } from \"solid-js/web\";\nimport { setAttribute as _$setAttribute } from \"solid-js/web\";\nimport { effect as _$effect } from \"solid-js/web\";\nimport { insert as _$insert } from \"solid-js/web\";\nimport { createComponent as _$createComponent } from \"solid-js/web\";\nvar _tmpl$ = /*#__PURE__*/_$template(`<div role=tablist class=context-sidebar__tablist>`),\n _tmpl$2 = /*#__PURE__*/_$template(`<button type=button role=tab class=context-sidebar__tab>`);\nimport { For } from \"solid-js\";\nexport function ContextTabs(props) {\n const activeToolId = () => {\n const ids = props.items().map(item => item.id);\n const selected = props.selectedToolId();\n return selected && ids.includes(selected) ? selected : ids[0];\n };\n return (() => {\n var _el$ = _tmpl$();\n _$insert(_el$, _$createComponent(For, {\n get each() {\n return props.items();\n },\n children: item => (() => {\n var _el$2 = _tmpl$2();\n _el$2.$$click = () => props.setSelectedToolId(item.id);\n _$insert(_el$2, () => item.name);\n _$effect(() => _$setAttribute(_el$2, \"data-active\", activeToolId() === item.id ? \"\" : void 0));\n return _el$2;\n })()\n }));\n return _el$;\n })();\n}\n_$delegateEvents([\"click\"]);", "import { template as _$template } from \"solid-js/web\";\nimport { effect as _$effect } from \"solid-js/web\";\nimport { getOwner as _$getOwner } from \"solid-js/web\";\nimport { createComponent as _$createComponent } from \"solid-js/web\";\nimport { memo as _$memo } from \"solid-js/web\";\nvar _tmpl$ = /*#__PURE__*/_$template(`<patchwork-view>`, true, false, false);\nimport { Show } from \"solid-js\";\nexport const slotId = slot => Array.isArray(slot) ? String(slot[0]) : String(slot);\nexport function SlotView(props) {\n return _$createComponent(Show, {\n get when() {\n return _$memo(() => !!Array.isArray(props.slot))() ? props.slot : false;\n },\n get fallback() {\n return (() => {\n var _el$ = _tmpl$();\n _el$._$owner = _$getOwner();\n _$effect(() => _el$.component = String(props.slot));\n return _el$;\n })();\n },\n children: tuple => (() => {\n var _el$2 = _tmpl$();\n _el$2._$owner = _$getOwner();\n _$effect(_p$ => {\n var _v$ = tuple()[1],\n _v$2 = tuple()[0];\n _v$ !== _p$.e && (_el$2.docUrl = _p$.e = _v$);\n _v$2 !== _p$.t && (_el$2.toolId = _p$.t = _v$2);\n return _p$;\n }, {\n e: undefined,\n t: undefined\n });\n return _el$2;\n })()\n });\n}", "import { template as _$template } from \"solid-js/web\";\nimport { effect as _$effect } from \"solid-js/web\";\nimport { getOwner as _$getOwner } from \"solid-js/web\";\nimport { insert as _$insert } from \"solid-js/web\";\nimport { memo as _$memo } from \"solid-js/web\";\nimport { createComponent as _$createComponent } from \"solid-js/web\";\nimport { use as _$use } from \"solid-js/web\";\nvar _tmpl$ = /*#__PURE__*/_$template(`<div class=document-view>`),\n _tmpl$2 = /*#__PURE__*/_$template(`<patchwork-view>`, true, false, false),\n _tmpl$3 = /*#__PURE__*/_$template(`<div class=placeholder>Select a document in the sidebar`);\nimport { Show } from \"solid-js\";\nexport function MainDocumentView({\n viewKey,\n selectedDocUrl,\n toolId,\n ref\n}) {\n return (() => {\n var _el$ = _tmpl$();\n var _ref$ = ref;\n typeof _ref$ === \"function\" ? _$use(_ref$, _el$) : ref = _el$;\n _$insert(_el$, _$createComponent(Show, {\n get when() {\n return viewKey();\n },\n keyed: true,\n children: key => {\n return (() => {\n var _el$2 = _tmpl$2();\n _el$2._$owner = _$getOwner();\n _$effect(_p$ => {\n var _v$ = selectedDocUrl(),\n _v$2 = toolId();\n _v$ !== _p$.e && (_el$2.docUrl = _p$.e = _v$);\n _v$2 !== _p$.t && (_el$2.toolId = _p$.t = _v$2);\n return _p$;\n }, {\n e: undefined,\n t: undefined\n });\n return _el$2;\n })();\n }\n }), null);\n _$insert(_el$, (() => {\n var _c$ = _$memo(() => !!!selectedDocUrl());\n return () => _c$() && _tmpl$3();\n })(), null);\n return _el$;\n })();\n}", ":root,\n:host,\n[theme] {\n --threepane-bg: var(--studio-fill, white);\n --threepane-sidebar-fill: var(--studio-chrome, var(--studio-fill, white));\n --threepane-fg: var(--studio-line, black);\n /* ink for text sitting ON the sidebar/account-bar chrome surface. mirrors the\n toolbar/context-sidebar fg: it rides --studio-chrome-line (the chrome's own\n ink) so it tracks the chrome palette, not the content page. --threepane-fg\n is content ink and only belongs on --threepane-bg surfaces. */\n --threepane-sidebar-fg: var(--studio-chrome-line, var(--studio-line, black));\n --threepane-muted: var(--studio-line-offset-50, #999);\n --threepane-family: var(--studio-family-sans, system-ui, sans-serif);\n --threepane-family-code: var(--studio-family-code, ui-monospace, monospace);\n\n /* spacing scale, aliased from the base theme */\n --threepane-space-3xs: var(--studio-space-3xs, 0.125rem);\n --threepane-space-2xs: var(--studio-space-2xs, 0.25rem);\n --threepane-space-xs: var(--studio-space-xs, 0.375rem);\n --threepane-space-sm: var(--studio-space-sm, 0.5rem);\n --threepane-space: var(--studio-space, 0.75rem);\n --threepane-space-md: var(--studio-space-md, 1rem);\n --threepane-space-2xl: var(--studio-space-2xl, 3rem);\n\n /* radius scale, aliased from the base theme */\n --threepane-radius-xs: var(--studio-radius-xs, 2px);\n --threepane-radius-sm: var(--studio-radius-sm, 4px);\n --threepane-radius-md: var(--studio-radius-md, 8px);\n --threepane-radius-round: var(--studio-radius-round, 9999px);\n\n /* Height of the frame's top strip: the top bar over the main column, and the\n matching empty space reserved above the left sidebar's widgets so the two\n line up and the left toggle has a home. */\n --threepane-header-height: calc(\n env(safe-area-inset-top, 0px) + var(--threepane-space-2xl)\n );\n\n /* the left footer and right tray boxes share one height so they line up. */\n --threepane-tray-height: var(--threepane-space-2xl);\n /* sidebar toggles ride a touch paler than the line (first ink offset). they\n sit on chrome (left toggle over the sidebar, right over the toolbar), so\n they use the chrome ink ramp, not the content one. */\n --threepane-toggle-fg: var(--studio-chrome-line-offset-10, var(--studio-line-offset-10, #333));\n\n --threepane-toolbar: var(--studio-chrome, white);\n /* toolbar text rides on the chrome surface, so it uses the chrome ink */\n --threepane-toolbar-fg: var(--studio-chrome-line, var(--studio-line, black));\n --threepane-toolbar-border: var(--studio-chrome-offset-10, #ddd);\n /* Resize handle: a faint 1px divider that tracks the chrome ramp's contrast\n (it mixes toward the chrome ink, so it reads darker on light themes and\n lighter on dark ones), plus a primary-tinted glow + grab pill on hover. */\n --threepane-sidebar-divider: var(--studio-chrome-offset-20, #d4d4d4);\n --threepane-resize-glow: color-mix(in oklch, var(--studio-primary-fill, var(--studio-primary, #35f7ca)), transparent 35%);\n --threepane-resize-pill: var(--studio-primary-fill, var(--studio-primary, #35f7ca));\n\n /* The context (right) sidebar sits on a chrome surface stepped one offset off\n the toolbar's flat chrome, so the two chrome regions read as distinct. */\n --threepane-context-sidebar-fill: var(--studio-chrome-offset-10, #ececec);\n\n /* Context sidebar (tabbed) */\n --context-sidebar-bg: var(--threepane-context-sidebar-fill);\n /* the tab-bar header rides on the same flat chrome as the toolbar above it,\n so the two chrome strips read as one continuous band */\n --context-sidebar-header-bg: var(--studio-chrome, #f2f2f2);\n --context-sidebar-fg: var(--studio-chrome-line, var(--studio-line, black));\n /* match the lines drawn around the document-view so tab/tray edges read as\n one continuous frame */\n --context-sidebar-border: var(--threepane-toolbar-border);\n --context-sidebar-tab-fg: var(--studio-chrome-line-offset-40, var(--studio-line-offset-40, #666));\n --context-sidebar-tab-hover: var(--studio-chrome-offset-10, #e5e5e5);\n --context-sidebar-tab-active-bg: var(--studio-fill, white);\n --context-sidebar-tab-active-fg: var(--studio-line, black);\n --context-sidebar-tab-active-accent: var(--studio-primary-line, var(--studio-primary, #35f7ca));\n /* the content panel shares the active tab's surface so the selected tab\n connects seamlessly into the tool view below it */\n --context-sidebar-content-bg: var(--context-sidebar-tab-active-bg);\n --context-sidebar-family: var(--studio-family-sans, system-ui, sans-serif);\n}\n\n.frame-shell {\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n}\n\n.frame-warning-banner {\n flex: none;\n padding: var(--threepane-space-2xs) var(--threepane-space-sm);\n text-align: center;\n text-transform: uppercase;\n font-family: var(--studio-family-ui, var(--threepane-family));\n font-size: 0.75rem;\n background: var(--studio-warning-fill, yellow);\n color: var(--studio-warning-line);\n}\n\n.frame {\n position: relative;\n display: flex;\n width: 100%;\n flex: 1;\n min-height: 0;\n font-family: var(--threepane-family);\n color: var(--threepane-fg);\n background: var(--threepane-bg);\n}\n\n.frame__version {\n position: absolute;\n top: var(--threepane-space-2xs);\n right: var(--threepane-space-sm);\n z-index: 10;\n color: var(--threepane-muted);\n font-size: 0.75rem;\n font-weight: 500;\n pointer-events: none;\n user-select: none;\n}\n\n.sidebar {\n position: relative;\n display: flex;\n flex: none;\n /* visible so the resize handle can straddle the boundary (sit on *both*\n sides of the divider line); the content clips itself instead. z-index lifts\n the handle's outer half above the main area so it stays grabbable. */\n overflow: visible;\n z-index: 1;\n}\n\n.sidebar[data-collapsed] {\n overflow: visible;\n}\n\n.sidebar[data-side=\"left\"] {\n background: var(--threepane-sidebar-fill);\n color: var(--threepane-sidebar-fg);\n}\n\n.sidebar[data-side=\"right\"] {\n background: var(--threepane-context-sidebar-fill);\n}\n\n.main-area {\n flex: 1;\n min-width: 0;\n display: flex;\n flex-direction: column;\n height: 100%;\n overflow: hidden;\n}\n\n/* The main column (right of the left sidebar): a row of\n [document column | right sidebar], so the right sidebar spans the full frame\n height and its resize divider runs top-to-bottom exactly like the left one. */\n.frame__main-column {\n position: relative;\n flex: 1;\n min-width: 0;\n display: flex;\n flex-direction: row;\n height: 100%;\n overflow: hidden;\n}\n\n/* The document column: the top bar over the main document view. Sits left of the\n full-height context sidebar. */\n.frame__doc-column {\n flex: 1;\n min-width: 0;\n width: 100%;\n display: flex;\n flex-direction: column;\n height: 100%;\n overflow: hidden;\n}\n\n.frame__doc-column > patchwork-view,\n.frame__doc-column > patchwork-view > patchwork-view,\n.frame__doc-column > patchwork-view > patchwork-view > patchwork-view,\n.frame__doc-column\n > patchwork-view\n > patchwork-view\n > patchwork-view\n > patchwork-view {\n display: contents;\n}\n\n/* The full-width top toolbar. Its height + top safe-area inset match the\n sideboard's reserved top margin so the bar reads as continuous across the top\n (the left sidebar's empty top region lines up with it). */\n.frame__topbar {\n display: flex;\n align-items: stretch;\n box-sizing: border-box;\n min-height: var(--threepane-space-2xl);\n padding-top: env(safe-area-inset-top, 0px);\n padding-inline: var(--threepane-space-2xs);\n gap: var(--threepane-space-2xs);\n background: var(--threepane-toolbar);\n color: var(--threepane-toolbar-fg);\n /* A hairline along the bottom, in the same colour as the document-view's\n border, so the line under the bar runs unbroken across the whole width\n (document column + context tabs). The active tab pulls down 1px to break\n through it and connect to its panel below. */\n border-bottom: 1px solid var(--threepane-toolbar-border);\n /* Animate the collapsed left-slot in step with the sidebar's width transition\n so the title glides up against the pinned toggle instead of jumping. */\n transition: padding-left var(--studio-transition-slow, 0.25s ease);\n}\n\n/* When the left sidebar is collapsed the bar's left edge reaches the frame edge,\n where the pinned left toggle lives; reserve a matching slot so the title slides\n up against the toggle rather than under it. */\n.frame__topbar--left-collapsed {\n padding-left: var(--threepane-space-2xl);\n}\n\n/* The left sidebar toggle, pinned to the frame's top-left corner so it keeps the\n same spot whether the sidebar is open or closed. Square, filling the top strip;\n sits over the sidebar's reserved (empty) top area when open. */\n.frame__left-toggle {\n position: absolute;\n top: 0;\n left: 0;\n z-index: 5;\n width: var(--threepane-space-2xl);\n height: var(--threepane-header-height);\n padding-top: env(safe-area-inset-top, 0px);\n}\n\n/* A sidebar toggle at either end of the top bar (always present). */\n.frame__sidebar-toggle {\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n padding-inline: var(--threepane-space-sm);\n border: none;\n background: transparent;\n color: var(--threepane-toggle-fg);\n cursor: pointer;\n transition: color var(--studio-transition-fast, 0.1s ease);\n}\n\n.frame__sidebar-toggle:hover {\n color: var(--threepane-sidebar-fg);\n}\n\n/* The document title, rendered intrinsically: shrinks to the title's width but\n never past half the bar; ellipsis beyond. */\n.threepane__title {\n display: flex;\n align-items: center;\n flex: 0 1 auto;\n min-width: 0;\n max-width: 50%;\n overflow: hidden;\n padding-inline: var(--threepane-space-sm);\n}\n\n.threepane__title-text {\n font-weight: 600;\n white-space: nowrap;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.threepane__title-text--editable {\n cursor: text;\n}\n\n.threepane__title-text--editable:hover {\n opacity: 0.7;\n}\n\n.threepane__title-input {\n font: inherit;\n font-weight: 600;\n color: inherit;\n min-width: 0;\n width: 100%;\n padding: 0;\n margin: 0;\n border: none;\n outline: none;\n background: transparent;\n}\n\n/* built-in spacer between the title and the right-hand tools */\n.threepane__spacer {\n flex: 1;\n min-width: var(--threepane-space-sm);\n}\n\n/* configured doctitle tools at the right end; scroll horizontally when they\n overflow rather than squashing. */\n.threepane__doctitle-tools {\n display: flex;\n align-items: center;\n gap: var(--threepane-space-sm);\n min-width: 0;\n padding-inline: var(--threepane-space-sm);\n overflow-x: auto;\n overflow-y: hidden;\n scrollbar-width: none;\n}\n\n.threepane__doctitle-tools::-webkit-scrollbar {\n display: none;\n}\n\n.threepane__doctitle-tools patchwork-view {\n display: flex;\n align-items: center;\n height: 2rem;\n flex-shrink: 0;\n width: auto;\n}\n\n.document-view {\n flex: 1;\n min-height: 0;\n overflow: hidden;\n /* Left divider only, square corners. The top line is the top bar's\n border-bottom and the bottom is open to the frame edge. The right divider\n (to the context sidebar) is the sidebar's own full-height border-left, so\n it runs the whole frame height rather than just the document view. When the\n left sidebar is collapsed the left divider is dropped (see the :has rule\n below) so nothing rides the frame edge. */\n border-left: 1px solid var(--threepane-toolbar-border);\n}\n\n/* Left sidebar collapsed to 0: drop the document-view's left divider so there's\n no stray line hugging the frame's left edge. */\n.frame:has(.sidebar[data-side=\"left\"][data-collapsed]) .document-view {\n border-left: none;\n}\n\n.document-view patchwork-view {\n display: block;\n width: 100%;\n height: 100%;\n}\n\n.placeholder {\n display: flex;\n align-items: center;\n justify-content: center;\n height: 100%;\n color: var(--threepane-fg);\n}\n\n.sidebar patchwork-view {\n display: block;\n width: 100%;\n height: 100%;\n /* the sidebar itself doesn't clip, so the content does */\n overflow: hidden;\n}\n\n/* Context sidebar (tabbed): lifted tabs with a top accent bar and surface fill\n on the active tab, a hover surface, and a bottom-border separator between the\n tab bar and the mounted tool view. */\n.context-sidebar {\n flex: 1;\n min-width: 0;\n width: 100%;\n height: 100%;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n font-family: var(--context-sidebar-family);\n color: var(--context-sidebar-fg);\n background: var(--context-sidebar-bg);\n /* The full-height divider between the document column and the sidebar. Lives\n here (not on the document view) so it runs the whole frame height \u2014 top bar\n level included \u2014 and the resize handle straddling this edge is grabbable end\n to end, matching the left sidebar. */\n border-left: 1px solid var(--context-sidebar-border);\n}\n\n/* Tab bar: the row holding the tab list and the collapse button. Its height +\n top safe-area inset match the document column's top bar so the two header\n strips line up and their bottom hairlines read as one continuous line across\n the divider. */\n.context-sidebar__tabs {\n display: flex;\n align-items: flex-end;\n box-sizing: border-box;\n min-height: var(--threepane-space-2xl);\n padding-top: env(safe-area-inset-top, 0px);\n background: var(--context-sidebar-header-bg);\n border-bottom: 1px solid var(--context-sidebar-border);\n}\n\n.context-sidebar__tablist {\n display: flex;\n flex: 1;\n min-width: 0;\n align-items: flex-end;\n gap: var(--threepane-space-2xs);\n padding-inline: var(--threepane-space-2xs);\n /* when there are more tabs than fit, scroll them horizontally rather than\n letting them shrink/wrap; scrollbar hidden for a clean header. */\n overflow-x: auto;\n overflow-y: hidden;\n scrollbar-width: none;\n /* extend the clip box 1px past the tab-bar border (compensated by the\n negative margin so layout is unchanged) so the active tab's -1px overflow\n isn't clipped by the horizontal scroll container, and it can still cover\n the border-bottom to connect into the panel. */\n padding-bottom: 1px;\n margin-bottom: -1px;\n}\n.context-sidebar__tablist::-webkit-scrollbar {\n display: none;\n}\n\n/* A single tab. */\n.context-sidebar__tab {\n display: flex;\n align-items: center;\n flex-shrink: 0;\n padding: var(--threepane-space-xs) var(--threepane-space-sm);\n border: 1px solid transparent;\n border-bottom: none;\n border-top-left-radius: var(--threepane-radius-xs);\n border-top-right-radius: var(--threepane-radius-xs);\n background: transparent;\n font-family: inherit;\n font-size: 0.875rem;\n white-space: nowrap;\n color: var(--context-sidebar-tab-fg);\n cursor: pointer;\n user-select: none;\n transition: background var(--studio-transition-fast, 0.1s ease),\n color var(--studio-transition-fast, 0.1s ease);\n}\n\n.context-sidebar__tab:hover {\n background: var(--context-sidebar-tab-hover);\n color: var(--context-sidebar-tab-active-fg);\n}\n\n/* Exception: the selected tab. Pulled down 1px so its fill covers the tab-bar's\n bottom border, connecting the tab seamlessly into the panel below. */\n.context-sidebar__tab[data-active] {\n position: relative;\n margin-bottom: -1px;\n background: var(--context-sidebar-tab-active-bg);\n color: var(--context-sidebar-tab-active-fg);\n border-color: var(--context-sidebar-border);\n box-shadow: inset 0 1px 0 0 var(--context-sidebar-tab-active-accent);\n}\n\n/* The close (collapse) button. Centred vertically in the tab header (the header\n is otherwise flex-end for the tabs) so it lands at the same height as the\n reopen toggle in the top bar when the sidebar is collapsed. */\n.context-sidebar__close {\n display: flex;\n align-items: center;\n justify-content: center;\n align-self: center;\n flex-shrink: 0;\n padding-inline: var(--threepane-space-sm);\n margin-right: var(--threepane-space-2xs);\n border: none;\n background: transparent;\n color: var(--context-sidebar-fg);\n cursor: pointer;\n opacity: 0.5;\n transition: opacity var(--studio-transition-fast, 0.1s ease);\n}\n\n.context-sidebar__close:hover {\n opacity: 1;\n}\n\n/* The mounted tool view. */\n.context-sidebar__content {\n flex: 1;\n min-height: 0;\n overflow: auto;\n background: var(--context-sidebar-content-bg);\n contain: content;\n}\n\n.context-sidebar__content patchwork-view {\n display: block;\n width: 100%;\n height: 100%;\n}\n\n/* Left sidebar body: a stack of widgets with the account footer pinned below. */\n.threepane-sidebar {\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n min-height: 0;\n}\n\n/* Reserve the docked tray's height at the sidebar's bottom so the account bar\n sits above the tray (which is pinned outside this collapsing column). */\n.threepane-sidebar--has-tray {\n padding-bottom: calc(\n var(--threepane-tray-height) + env(safe-area-inset-bottom, 0px)\n );\n}\n\n/* account / packages / settings footer, pinned to the sidebar bottom */\n.threepane-sidebar--has-tray .threepane-sidebar__footer {\n flex: none;\n margin-bottom: calc(var(--threepane-tray-height) + env(safe-area-inset-bottom, 0px));\n}\n\n/* The inlined account bar: avatar (account picker) + Packages + Settings. */\n.threepane-account-bar {\n container-type: inline-size;\n display: flex;\n align-items: center;\n gap: var(--threepane-space-md);\n min-height: var(--threepane-space-2xl);\n box-sizing: border-box;\n background: var(--threepane-sidebar-fill);\n color: var(--threepane-sidebar-fg);\n border-top: 1px solid var(--threepane-sidebar-divider);\n padding-block: var(--threepane-space-2xs);\n padding-bottom: calc(var(--threepane-space-2xs) + env(safe-area-inset-bottom));\n padding-left: calc(env(safe-area-inset-left) + var(--threepane-space-md));\n padding-right: calc(env(safe-area-inset-right) + var(--threepane-space-md));\n justify-content: space-between;\n overflow: hidden;\n}\n\n.threepane-account-bar__button {\n display: flex;\n align-items: center;\n border: 1px solid transparent;\n padding-inline: var(--threepane-space-2xs);\n padding-block: var(--threepane-space-3xs);\n border-radius: var(--threepane-radius-xs);\n background: transparent;\n color: inherit;\n font: inherit;\n white-space: nowrap;\n cursor: pointer;\n}\n\n.threepane-account-bar__button:hover {\n border-color: var(--threepane-sidebar-divider);\n}\n\n.threepane-account-bar__avatar {\n padding: 0;\n}\n\n.threepane-account-bar__avatar patchwork-view {\n display: block;\n width: 100%;\n height: 100%;\n}\n\n/* Left sidebar: a stack of configured widgets. The widgets start below the\n frame's top strip (the empty space matching the top bar), so the frame owns\n that spacing rather than each widget reserving its own top margin. */\n.threepane-widgets {\n flex: 1;\n display: flex;\n flex-direction: column;\n width: 100%;\n min-height: 0;\n padding-top: var(--threepane-header-height);\n gap: 1rem;\n}\n\n.threepane-widget {\n position: relative;\n flex: 1;\n min-height: 0;\n overflow: hidden;\n}\n\n.threepane-widget patchwork-view {\n display: block;\n width: 100%;\n height: 100%;\n}\n\n/* empty state: offer to add the document list */\n.threepane-widgets__empty {\n flex: 1;\n display: flex;\n align-items: flex-start;\n justify-content: center;\n}\n\n.threepane-widgets__add {\n padding: var(--threepane-space-xs) var(--threepane-space-sm);\n border: 1px dashed var(--threepane-sidebar-divider);\n border-radius: var(--threepane-radius-sm);\n background: transparent;\n color: var(--threepane-muted);\n font: inherit;\n cursor: pointer;\n white-space: nowrap;\n}\n\n.threepane-widgets__add:hover:not(:disabled) {\n color: var(--threepane-sidebar-fg);\n border-color: var(--threepane-sidebar-fg);\n}\n\n.threepane-widgets__add:disabled {\n opacity: 0.5;\n cursor: default;\n}\n\n/* System tray dock: pinned to the frame's bottom-left. Lives outside the\n collapsing left sidebar so it isn't torn down when the sidebar closes. When\n the sidebar is open the dock spans its width (set inline) and fills the space\n reserved by `threepane-sidebar--has-tray`; when the sidebar closes the dock is\n hidden (`display: none`) but stays mounted, so the tray is invisible while its\n tools keep running. */\n.frame__tray-dock {\n position: absolute;\n left: 0;\n bottom: 0;\n z-index: 4;\n box-sizing: border-box;\n /* Fade the tray in only *after* the sidebar's width animation completes, so it\n doesn't flash at full size over the still-expanding sidebar. The delay equals\n the sidebar's transition duration; collapsing overrides this to hide at once. */\n opacity: 1;\n transition: opacity 0.1s ease 0.25s;\n}\n\n.frame__tray-dock--collapsed {\n opacity: 0;\n pointer-events: none;\n /* Hide immediately on collapse \u2014 no wait, no fade. */\n transition: opacity 0s;\n}\n\n/* A row of tray-tagged tools, filling the dock. */\n.frame-tray {\n display: flex;\n align-items: center;\n gap: var(--threepane-space-2xs);\n box-sizing: border-box;\n /* min-height includes the safe-area inset (border-box), and the matching\n padding-bottom lifts the tray's contents clear of it while the tray's own\n background fills the inset down to the very bottom edge. */\n min-height: calc(\n var(--threepane-tray-height) + env(safe-area-inset-bottom, 0px)\n );\n padding-inline: var(--threepane-space-sm);\n padding-bottom: env(safe-area-inset-bottom, 0px);\n border-top: 1px solid var(--threepane-sidebar-divider);\n background: var(--threepane-sidebar-fill);\n}\n\n.frame-tray__item {\n display: flex;\n align-items: center;\n}\n\n.frame-tray patchwork-view {\n display: flex;\n width: auto;\n height: auto;\n}\n\n/* Debug Registry Toast */\n.debug-registry-toast {\n position: fixed;\n bottom: var(--threepane-space-md);\n right: var(--threepane-space-md);\n z-index: 9999;\n max-width: 360px;\n font-family: var(--threepane-family-code);\n font-size: 0.75rem;\n background: oklch(0.15 0.01 270);\n border: 1px solid oklch(0.35 0.03 270);\n border-radius: var(--threepane-radius-md);\n box-shadow:\n 0 8px 32px oklch(0 0 0 / 0.4),\n 0 0 0 1px oklch(1 0 0 / 0.05) inset;\n overflow: hidden;\n backdrop-filter: blur(12px);\n}\n\n.debug-registry-toast__header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: var(--threepane-space-sm) var(--threepane-space);\n background: oklch(0.2 0.02 270);\n border-bottom: 1px solid oklch(0.3 0.02 270);\n}\n\n.debug-registry-toast__title {\n color: oklch(0.85 0.1 270);\n font-weight: 600;\n letter-spacing: 0.02em;\n}\n\n.debug-registry-toast__clear {\n background: none;\n border: none;\n color: oklch(0.6 0.05 270);\n cursor: pointer;\n padding: var(--threepane-space-2xs) var(--threepane-space-sm);\n border-radius: var(--threepane-radius-sm);\n transition: all 0.15s ease;\n}\n\n.debug-registry-toast__clear:hover {\n background: oklch(0.25 0.02 270);\n color: oklch(0.9 0.05 0);\n}\n\n.debug-registry-toast__list {\n max-height: 300px;\n overflow-y: auto;\n}\n\n.debug-registry-toast__item {\n display: flex;\n align-items: flex-start;\n gap: var(--threepane-space-sm);\n padding: var(--threepane-space-sm) var(--threepane-space);\n border-left: 3px solid transparent;\n cursor: pointer;\n transition: all 0.15s ease;\n animation: toast-slide-in 0.2s ease-out;\n}\n\n.debug-registry-toast__item:hover {\n background: oklch(0.2 0.01 270);\n}\n\n.debug-registry-toast__item:not(:last-child) {\n border-bottom: 1px solid oklch(0.25 0.01 270);\n}\n\n.debug-registry-toast__icon {\n font-size: 0.875rem;\n line-height: 1;\n flex-shrink: 0;\n}\n\n.debug-registry-toast__content {\n display: flex;\n flex-direction: column;\n gap: var(--threepane-space-3xs);\n min-width: 0;\n}\n\n.debug-registry-toast__event-type {\n color: oklch(0.7 0.15 150);\n font-weight: 600;\n text-transform: uppercase;\n letter-spacing: 0.05em;\n font-size: 0.625rem;\n}\n\n.debug-registry-toast__plugin-type {\n color: oklch(0.6 0.1 60);\n font-size: 0.6875rem;\n}\n\n.debug-registry-toast__plugin-id {\n color: oklch(0.9 0.02 270);\n font-weight: 500;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n}\n@keyframes toast-slide-in {\n from {\n opacity: 0;\n transform: translateX(20px);\n }\n to {\n opacity: 1;\n transform: translateX(0);\n }\n}\n\n\n/* Isolation-mode chrome popover.\n In isolation the main document area is a sandboxed iframe, so host-realm tools\n opened from the account bar (account picker / Packages / Settings) are floated\n over the frame here instead of being routed into the iframe. The backdrop is a\n lowish-opacity, theme-tinted ink wash (dims the frame + picks up the theme's\n ink hue); the panel carries a soft drop shadow so it reads as lifted. Absolute\n inset:0 resolves to the `.frame` (its nearest positioned ancestor). */\n.frame__popover-backdrop {\n position: absolute;\n inset: 0;\n z-index: 1000;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: var(--threepane-space-2xl);\n background: color-mix(in oklch, var(--threepane-fg), transparent 82%);\n animation: frame-popover-fade var(--studio-transition, 0.15s ease);\n}\n\n.frame__popover {\n display: flex;\n flex-direction: column;\n width: min(1100px, 100%);\n height: min(900px, 100%);\n overflow: hidden;\n background: var(--threepane-bg);\n color: var(--threepane-fg);\n border: 1px solid var(--threepane-toolbar-border);\n border-radius: var(--threepane-radius-md);\n box-shadow:\n 0 32px 80px color-mix(in oklch, var(--threepane-fg), transparent 45%),\n 0 12px 32px color-mix(in oklch, var(--threepane-fg), transparent 60%),\n 0 2px 8px color-mix(in oklch, var(--threepane-fg), transparent 70%);\n animation: frame-popover-pop var(--studio-transition, 0.15s ease);\n}\n\n/* The \"Open with\" picker, docked to the popover's top. Sits at its natural\n height above the tool body; the doc-openwith tool renders a small titlebar\n button, so this is left-aligned chrome rather than a full-height view. */\n.frame__popover-toolbar {\n display: flex;\n align-items: center;\n flex: 0 0 auto;\n gap: var(--threepane-space-sm);\n padding: var(--threepane-space-sm) var(--threepane-space-md);\n border-bottom: 1px solid var(--threepane-toolbar-border);\n}\n\n.frame__popover-toolbar patchwork-view {\n display: block;\n}\n\n.frame__popover-body {\n flex: 1 1 auto;\n min-height: 0;\n overflow: auto;\n}\n\n.frame__popover-body patchwork-view {\n display: block;\n width: 100%;\n height: 100%;\n overflow: auto;\n}\n\n@keyframes frame-popover-fade {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n\n@keyframes frame-popover-pop {\n from {\n opacity: 0;\n transform: translateY(8px) scale(0.98);\n }\n to {\n opacity: 1;\n transform: none;\n }\n}\n\n/* Custom colors for event types */\n:root,\n:host,\n[theme] {\n --debug-toast-registered: var(--studio-secondary-text, color-mix(in oklch, var(--studio-secondary, #33ccf8), var(--studio-line, black) 20%));\n --debug-toast-loaded: color-mix(in oklch, var(--studio-added, #35f7ca), var(--studio-line, black) 10%);\n --debug-toast-removed: var(--studio-danger-text, color-mix(in oklch, var(--studio-danger, #ff6a90), var(--studio-line, black) 20%));\n --debug-toast-changed: var(--studio-warning-text, color-mix(in oklch, var(--studio-warning, #f8c43b), var(--studio-line, black) 10%));\n}\n\n.frame {\n.sidebar-toggle {\n position: relative;\n align-self: stretch;\n height: 100%;\n padding: 0;\n /* 1px wide, overlapping the divider border while reserving no layout column\n (content stays flush against the view's border - no offset-bg seam). The\n divider border is painted inside the following column, so a centered 2px\n strip reads half a pixel left of the line. */\n width: 1px;\n margin-inline: 0 -1px;\n margin-block: 0;\n border: 0;\n z-index: 1;\n cursor: pointer;\n /* transparent at rest - the visible divider is the main view's border; the\n handle lights up (full-height glow + pill) on hover to signal resize. */\n background: transparent;\n transition: background-color var(--studio-transition, 0.15s ease);\n /* invisible hit target straddling the divider. The toggle sits on opposite\n edges of the two sidebars (right edge of the left pane, left edge of the\n right pane), so the asymmetric grab margin is mirrored per side to stay\n centred over the divider line. */\n &::before {\n content: \"\";\n position: absolute;\n inset-block: 0;\n }\n &::after {\n content: \"\";\n position: absolute;\n top: 50%;\n left: 50%;\n width: 5px;\n height: 44px;\n border-radius: var(--threepane-radius-round);\n background: var(--threepane-resize-pill);\n opacity: 0;\n transform: translate(-50%, -50%) scaleY(0.55);\n transition: opacity var(--studio-transition, 0.15s ease),\n transform var(--studio-transition, 0.15s ease);\n pointer-events: none;\n }\n /* on hover the divider line lights up in the frame primary */\n &:hover,\n &:active {\n background: var(--threepane-resize-glow);\n }\n &:hover::after,\n &:active::after {\n opacity: 1;\n transform: translate(-50%, -50%) scaleY(1);\n }\n}\n\n.sidebar-toggle--resizable {\n cursor: col-resize;\n &:hover {\n cursor: col-resize;\n }\n &:active {\n cursor: col-resize;\n }\n}\n\n}\n\n/* Animate sidebar width on collapse/expand, but never while the handle is being\n actively dragged - the width must track the pointer 1:1 with no easing lag.\n The body flag is set for the duration of a drag by `useSidebarResize`. */\n.sidebar {\n transition: width var(--studio-transition-slow, 0.25s ease);\n}\nbody[data-sidebar-resizing] .sidebar {\n transition: none;\n}\n", "// Imported as a string (not a side-effect import) so the stylesheet is only\n// injected when the frame tool actually activates \u2014 not when index.js loads.\n// esbuild's `.css` text loader (esbuild/options.ts) returns the CSS source.\nimport frameStyles from \"./styles.css\";\n\n/**\n * Inject the threepane stylesheet into the current realm's document, once.\n *\n * Called from both realms: host-side by `PatchworkFrame`, and inside the isolated iframe by\n * `IsolationRoot`.\n */\nexport function ensureFrameStyles() {\n const id = \"patchwork-frame-styles\";\n const existing = document.getElementById(id);\n if (existing) {\n // Already injected in this realm. Refresh its contents if the bundled CSS\n // has changed (a remount after a rebuild) so a stale stylesheet from an\n // earlier mount can't shadow newer rules; otherwise leave it untouched.\n if (existing.textContent !== frameStyles) existing.textContent = frameStyles;\n return;\n }\n const el = document.createElement(\"style\");\n el.id = id;\n el.textContent = frameStyles;\n document.head.append(el);\n}\n"],
5
- "mappings": "iDAAA,IAAAA,GAAAC,GAAA,CAAAC,GAAAC,KAAA,CAIA,IAAIC,EAAI,IACJC,EAAID,EAAI,GACRE,EAAID,EAAI,GACRE,EAAID,EAAI,GACRE,GAAID,EAAI,EACRE,GAAIF,EAAI,OAgBZJ,GAAO,QAAU,SAAUO,EAAKC,EAAS,CACvCA,EAAUA,GAAW,CAAC,EACtB,IAAIC,EAAO,OAAOF,EAClB,GAAIE,IAAS,UAAYF,EAAI,OAAS,EACpC,OAAOG,GAAMH,CAAG,EACX,GAAIE,IAAS,UAAY,SAASF,CAAG,EAC1C,OAAOC,EAAQ,KAAOG,GAAQJ,CAAG,EAAIK,GAASL,CAAG,EAEnD,MAAM,IAAI,MACR,wDACE,KAAK,UAAUA,CAAG,CACtB,CACF,EAUA,SAASG,GAAMG,EAAK,CAElB,GADAA,EAAM,OAAOA,CAAG,EACZ,EAAAA,EAAI,OAAS,KAGjB,KAAIC,EAAQ,mIAAmI,KAC7ID,CACF,EACA,GAAKC,EAGL,KAAIC,EAAI,WAAWD,EAAM,CAAC,CAAC,EACvBL,GAAQK,EAAM,CAAC,GAAK,MAAM,YAAY,EAC1C,OAAQL,EAAM,CACZ,IAAK,QACL,IAAK,OACL,IAAK,MACL,IAAK,KACL,IAAK,IACH,OAAOM,EAAIT,GACb,IAAK,QACL,IAAK,OACL,IAAK,IACH,OAAOS,EAAIV,GACb,IAAK,OACL,IAAK,MACL,IAAK,IACH,OAAOU,EAAIX,EACb,IAAK,QACL,IAAK,OACL,IAAK,MACL,IAAK,KACL,IAAK,IACH,OAAOW,EAAIZ,EACb,IAAK,UACL,IAAK,SACL,IAAK,OACL,IAAK,MACL,IAAK,IACH,OAAOY,EAAIb,EACb,IAAK,UACL,IAAK,SAC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h", "d", "w", "y", "val", "options", "type", "parse", "fmtLong", "fmtShort", "str", "match", "n", "ms", "msAbs", "plural", "name", "isPlural", "require_common", "__commonJSMin", "exports", "module", "setup", "env", "createDebug", "coerce", "disable", "enable", "enabled", "destroy", "key", "selectColor", "namespace", "hash", "i", "prevTime", "enableOverride", "namespacesCache", "enabledCache", "debug", "args", "self", "curr", "ms", "index", "match", "format", "formatter", "val", "extend", "v", "delimiter", "newDebug", "namespaces", "split", "ns", "matchesTemplate", "search", "template", "searchIndex", "templateIndex", "starIndex", "matchIndex", "name", "skip", "require_browser", "__commonJSMin", "exports", "module", "formatArgs", "save", "load", "useColors", "localstorage", "warned", "m", "args", "c", "index", "lastC", "match", "namespaces", "r", "formatters", "v", "error", "_$template", "_$createComponent", "_$setAttribute", "_$effect", "_$insert", "_$getOwner", "createMemo", "createStore", "reconcile", "render", "_$template", "_$insert", "_$getOwner", "_$use", "_$createComponent", "createUniqueId", "untrack", "isServer", "isDev", "reconcile", "makePersisted", "signal", "options", "storage", "name", "storageOptions", "serialize", "deserialize", "init", "set", "data", "value", "e", "unchanged", "get", "output", "serialized", "args", "createEffect", "createMemo", "createSignal", "on", "onCleanup", "onMount", "Show", "createEffect", "createSignal", "on", "SIDEBAR_KEYS", "COLLAPSE_CONTEXT_SIDEBAR_EVENT", "DEFAULT_SIDEBAR_WIDTH", "getStoredNumber", "key", "defaultValue", "stored", "getStoredBoolean", "useSidebarState", "isSidebarCollapsed", "setIsSidebarCollapsed", "isRightSidebarCollapsed", "setIsRightSidebarCollapsed", "leftSidebarWidth", "setLeftSidebarWidth", "rightSidebarWidth", "setRightSidebarWidth", "value", "onCleanup", "onMount", "useSidebarResize", "setLeftSidebarWidth", "setRightSidebarWidth", "setIsSidebarCollapsed", "setIsRightSidebarCollapsed", "isLeftCollapsed", "isRightCollapsed", "minWidth", "maxWidth", "autoCloseWidth", "dragThreshold", "isResizing", "dragStartPos", "hasDragged", "lastDragWidth", "setWidth", "side", "w", "setCollapsed", "value", "isCollapsed", "applyDragWidth", "raw", "settleDrag", "dragOverlay", "beginDragVisuals", "endDrag", "handleMouseDown", "e", "handleMouseUp", "dragged", "handleMouseMove", "deltaX", "deltaY", "handleToggleClick", "prev", "createEffect", "createSignal", "onCleanup", "useProviderReady", "componentId", "element", "isReady", "setReady", "el", "onMounted", "event", "createEffect", "createSignal", "onCleanup", "MOUNT_TIMEOUT_MS", "useMainDocMounted", "element", "docUrl", "isMounted", "setMounted", "el", "url", "onSettled", "event", "detail", "timer", "getRegistry", "createMemo", "createSignal", "onCleanup", "useTaggedComponents", "tag", "registry", "version", "setVersion", "off", "v", "description", "a", "b", "_$template", "_$delegateEvents", "_$setStyleProperty", "_$effect", "_$memo", "_$addEventListener", "_$insert", "createEffect", "createSignal", "onCleanup", "getAllRegistries", "_tmpl$", "_tmpl$2", "_tmpl$3", "DEBUG_MODAL_KEY", "isDebugModalEnabled", "setDebugModalEnabled", "enabled", "DEFAULT_EVENTS", "useDebugRegistryToast", "options", "subscribedEvents", "events", "setEvents", "isEnabled", "setIsEnabled", "timeouts", "addEvent", "type", "event", "pluginId", "pluginName", "newEvent", "prev", "timeoutId", "e", "dismissEvent", "eventId", "clearAll", "id", "registries", "unsubscribes", "lastPluginInfo", "registry", "trackRegistered", "plugin", "trackLoaded", "trackRemoved", "unsub", "info", "handleStorageChange", "DebugRegistryToast", "onDismiss", "onClearAll", "eventColor", "_el$", "_el$2", "_el$3", "_el$4", "_el$6", "_el$5", "_el$7", "_el$8", "_el$9", "_el$0", "_el$1", "_el$10", "_c$", "_el$11", "_$p", "_$template", "_$delegateEvents", "_$getOwner", "_$effect", "_$setAttribute", "_$memo", "_$insert", "_$createComponent", "For", "Show", "_$template", "_$delegateEvents", "_$setAttribute", "_$insert", "_$effect", "_$use", "_$createComponent", "import_debug", "log", "debug", "pojo", "target", "BLOCK_MARKER", "apply", "rest", "path", "range", "val", "p", "key", "RANGE_ARRAY", "start", "end", "ZERO_LENGTH", "DELETE", "INSERT", "APPEND", "REPLACE", "seq", "n", "a", "b", "nextkey", "get", "obj", "key", "p", "fromAutomerge", "autopatch", "payload", "path", "log", "autoproduce", "payload", "doc", "patch", "apply", "fromAutomerge", "createMemo", "onCleanup", "createStore", "produce", "reconcile", "cache", "makeDocumentProjection", "handle", "onCleanup", "item", "doc", "set", "patch", "ondelete", "payload", "autoproduce", "getOwner", "onCleanup", "createSignal", "untrack", "sharedConfig", "onMount", "DEV", "equalFn", "isServer", "access", "v", "createDocumentProjection", "handle", "createMemo", "access", "makeDocumentProjection", "createEffect", "createResource", "useContext", "createContext", "RepoContext", "useDocHandle", "url", "options", "contextRepo", "useContext", "RepoContext", "repo", "getExistingHandle", "unwrappedURL", "access", "state", "handle", "mutate", "createResource", "createEffect", "useDocument", "url", "options", "handle", "useDocHandle", "createDocumentProjection", "onCleanup", "createSignal", "createEffect", "onCleanup", "createSignal", "useContext", "getType", "getRegistry", "isLoadedPlugin", "createEffect", "createMemo", "createSignal", "onCleanup", "onMount", "Show", "_tmpl$", "_$template", "_tmpl$2", "DocumentTitle", "props", "anchor", "repo", "setRepo", "_$createComponent", "_el$", "_ref$", "_$use", "resolvedRepo", "DocumentTitleInner", "doc", "handle", "useDocument", "registry", "registryVersion", "setRegistryVersion", "off", "v", "typeId", "d", "id", "datatype", "dt", "title", "canEdit", "editing", "setEditing", "inputRef", "startEditing", "commit", "save", "next", "h", "setTitle", "meta", "_el$3", "_$insert", "_$effect", "_p$", "_v$", "_v$2", "_$setAttribute", "_el$2", "e", "_ref$2", "_$delegateEvents", "_$template", "_$delegateEvents", "_$getOwner", "_$insert", "_$createComponent", "Show", "_$template", "_$delegateEvents", "_$setStyleProperty", "_$setAttribute", "_$insert", "_$memo", "_$effect", "_$getOwner", "_tmpl$", "_tmpl$2", "_tmpl$3", "_tmpl$4", "Sidebar", "props", "widthStyle", "content", "_el$", "_p$", "_v$", "_v$2", "canExpand", "_el$2", "_c$", "_c$2", "_el$3", "e", "_c$3", "_el$4", "_c$4", "_el$5", "_c$5", "_el$6", "_c$6", "_v$3", "_v$4", "_v$5", "_$template", "_$delegateEvents", "_$setAttribute", "_$effect", "_$insert", "_$createComponent", "For", "_tmpl$", "_tmpl$2", "ContextTabs", "props", "activeToolId", "ids", "item", "selected", "_el$", "_el$2", "_tmpl$", "_$template", "_tmpl$2", "_tmpl$3", "_tmpl$4", "_tmpl$5", "ContextSidebar", "props", "items", "useTaggedComponents", "activeToolId", "ids", "item", "selected", "_$createComponent", "Sidebar", "_el$", "_$insert", "Show", "_el$2", "_el$3", "ContextTabs", "PanelRightIcon", "_el$4", "id", "_el$5", "_$getOwner", "_$delegateEvents", "_$template", "_$effect", "_$getOwner", "_$createComponent", "_$memo", "Show", "_tmpl$", "slotId", "slot", "SlotView", "props", "_el$", "tuple", "_el$2", "_p$", "_v$", "_v$2", "_tmpl$", "_$template", "_tmpl$2", "_tmpl$3", "_tmpl$4", "_tmpl$5", "FrameTopBar", "props", "docToolSlots", "_el$", "_el$3", "_$insert", "_$createComponent", "Show", "_el$2", "DocumentTitle", "_$memo", "_el$4", "For", "slot", "_el$6", "_$getOwner", "_$effect", "_p$", "_v$", "slotId", "_v$2", "_el$5", "_$setAttribute", "PanelRightIcon", "_$delegateEvents", "_$template", "_$effect", "_$getOwner", "_$insert", "_$memo", "_$createComponent", "_$use", "Show", "_tmpl$", "_tmpl$2", "_tmpl$3", "MainDocumentView", "viewKey", "selectedDocUrl", "toolId", "ref", "_el$", "_ref$", "key", "_el$2", "_p$", "_v$", "_v$2", "_c$", "_tmpl$", "_$template", "_tmpl$2", "_tmpl$3", "MIN_SIDEBAR_WIDTH", "MAX_SIDEBAR_WIDTH", "AUTO_CLOSE_WIDTH", "DRAG_THRESHOLD", "DocumentAreaRoot", "props", "isRightSidebarCollapsed", "setIsRightSidebarCollapsed", "createSignal", "rightSidebarWidth", "setRightSidebarWidth", "createEffect", "on", "value", "SIDEBAR_KEYS", "setUnusedLeftWidth", "setUnusedLeftCollapsed", "sidebarResize", "useSidebarResize", "onMount", "onCollapse", "COLLAPSE_CONTEXT_SIDEBAR_EVENT", "onCleanup", "selectedContextToolId", "setSelectedContextToolId", "makePersisted", "draftStateProviderHost", "setDraftStateProviderHost", "isDraftStateProviderReady", "useProviderReady", "readyDraftStateHost", "_$createComponent", "Show", "docUrl", "_el$", "_$use", "_$getOwner", "_$insert", "host", "DraftDocumentArea", "contextItems", "useTaggedComponents", "hasContext", "mainViewKey", "createMemo", "draftOverlayProviderHost", "setDraftOverlayProviderHost", "isDraftOverlayProviderReady", "commentsProviderElement", "setCommentsProviderElement", "isCommentsProviderReady", "focusProviderElement", "setFocusProviderElement", "isFocusProviderReady", "areDocProvidersReady", "_el$2", "_el$3", "_el$4", "_el$5", "_el$6", "_el$7", "FrameTopBar", "v", "MainDocumentView", "el", "ContextSidebar", "styles_default", "ensureFrameStyles", "id", "existing", "styles_default", "el", "_tmpl$", "_$template", "_tmpl$2", "IsolatedDocumentArea", "props", "rootUrls", "createMemo", "urls", "selected", "propsJson", "_el$", "_el$2", "_$getOwner", "_$insert", "_$effect", "_$setAttribute", "parseProps", "script", "err", "mountIsolationRoot", "element", "ensureFrameStyles", "p", "setP", "createStore", "observer", "reconcile", "dispose", "render", "_el$3", "_$createComponent", "DocumentAreaRoot", "DEFAULT_SIDEBAR_WIDTH"]
4
+ "sourcesContent": ["/**\n * Helpers.\n */\n\nvar s = 1000;\nvar m = s * 60;\nvar h = m * 60;\nvar d = h * 24;\nvar w = d * 7;\nvar y = d * 365.25;\n\n/**\n * Parse or format the given `val`.\n *\n * Options:\n *\n * - `long` verbose formatting [false]\n *\n * @param {String|Number} val\n * @param {Object} [options]\n * @throws {Error} throw an error if val is not a non-empty string or a number\n * @return {String|Number}\n * @api public\n */\n\nmodule.exports = function (val, options) {\n options = options || {};\n var type = typeof val;\n if (type === 'string' && val.length > 0) {\n return parse(val);\n } else if (type === 'number' && isFinite(val)) {\n return options.long ? fmtLong(val) : fmtShort(val);\n }\n throw new Error(\n 'val is not a non-empty string or a valid number. val=' +\n JSON.stringify(val)\n );\n};\n\n/**\n * Parse the given `str` and return milliseconds.\n *\n * @param {String} str\n * @return {Number}\n * @api private\n */\n\nfunction parse(str) {\n str = String(str);\n if (str.length > 100) {\n return;\n }\n var match = /^(-?(?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(\n str\n );\n if (!match) {\n return;\n }\n var n = parseFloat(match[1]);\n var type = (match[2] || 'ms').toLowerCase();\n switch (type) {\n case 'years':\n case 'year':\n case 'yrs':\n case 'yr':\n case 'y':\n return n * y;\n case 'weeks':\n case 'week':\n case 'w':\n return n * w;\n case 'days':\n case 'day':\n case 'd':\n return n * d;\n case 'hours':\n case 'hour':\n case 'hrs':\n case 'hr':\n case 'h':\n return n * h;\n case 'minutes':\n case 'minute':\n case 'mins':\n case 'min':\n case 'm':\n return n * m;\n case 'seconds':\n case 'second':\n case 'secs':\n case 'sec':\n case 's':\n return n * s;\n case 'milliseconds':\n case 'millisecond':\n case 'msecs':\n case 'msec':\n case 'ms':\n return n;\n default:\n return undefined;\n }\n}\n\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtShort(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return Math.round(ms / d) + 'd';\n }\n if (msAbs >= h) {\n return Math.round(ms / h) + 'h';\n }\n if (msAbs >= m) {\n return Math.round(ms / m) + 'm';\n }\n if (msAbs >= s) {\n return Math.round(ms / s) + 's';\n }\n return ms + 'ms';\n}\n\n/**\n * Long format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtLong(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return plural(ms, msAbs, d, 'day');\n }\n if (msAbs >= h) {\n return plural(ms, msAbs, h, 'hour');\n }\n if (msAbs >= m) {\n return plural(ms, msAbs, m, 'minute');\n }\n if (msAbs >= s) {\n return plural(ms, msAbs, s, 'second');\n }\n return ms + ' ms';\n}\n\n/**\n * Pluralization helper.\n */\n\nfunction plural(ms, msAbs, n, name) {\n var isPlural = msAbs >= n * 1.5;\n return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');\n}\n", "\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n */\n\nfunction setup(env) {\n\tcreateDebug.debug = createDebug;\n\tcreateDebug.default = createDebug;\n\tcreateDebug.coerce = coerce;\n\tcreateDebug.disable = disable;\n\tcreateDebug.enable = enable;\n\tcreateDebug.enabled = enabled;\n\tcreateDebug.humanize = require('ms');\n\tcreateDebug.destroy = destroy;\n\n\tObject.keys(env).forEach(key => {\n\t\tcreateDebug[key] = env[key];\n\t});\n\n\t/**\n\t* The currently active debug mode names, and names to skip.\n\t*/\n\n\tcreateDebug.names = [];\n\tcreateDebug.skips = [];\n\n\t/**\n\t* Map of special \"%n\" handling functions, for the debug \"format\" argument.\n\t*\n\t* Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n\t*/\n\tcreateDebug.formatters = {};\n\n\t/**\n\t* Selects a color for a debug namespace\n\t* @param {String} namespace The namespace string for the debug instance to be colored\n\t* @return {Number|String} An ANSI color code for the given namespace\n\t* @api private\n\t*/\n\tfunction selectColor(namespace) {\n\t\tlet hash = 0;\n\n\t\tfor (let i = 0; i < namespace.length; i++) {\n\t\t\thash = ((hash << 5) - hash) + namespace.charCodeAt(i);\n\t\t\thash |= 0; // Convert to 32bit integer\n\t\t}\n\n\t\treturn createDebug.colors[Math.abs(hash) % createDebug.colors.length];\n\t}\n\tcreateDebug.selectColor = selectColor;\n\n\t/**\n\t* Create a debugger with the given `namespace`.\n\t*\n\t* @param {String} namespace\n\t* @return {Function}\n\t* @api public\n\t*/\n\tfunction createDebug(namespace) {\n\t\tlet prevTime;\n\t\tlet enableOverride = null;\n\t\tlet namespacesCache;\n\t\tlet enabledCache;\n\n\t\tfunction debug(...args) {\n\t\t\t// Disabled?\n\t\t\tif (!debug.enabled) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst self = debug;\n\n\t\t\t// Set `diff` timestamp\n\t\t\tconst curr = Number(new Date());\n\t\t\tconst ms = curr - (prevTime || curr);\n\t\t\tself.diff = ms;\n\t\t\tself.prev = prevTime;\n\t\t\tself.curr = curr;\n\t\t\tprevTime = curr;\n\n\t\t\targs[0] = createDebug.coerce(args[0]);\n\n\t\t\tif (typeof args[0] !== 'string') {\n\t\t\t\t// Anything else let's inspect with %O\n\t\t\t\targs.unshift('%O');\n\t\t\t}\n\n\t\t\t// Apply any `formatters` transformations\n\t\t\tlet index = 0;\n\t\t\targs[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {\n\t\t\t\t// If we encounter an escaped % then don't increase the array index\n\t\t\t\tif (match === '%%') {\n\t\t\t\t\treturn '%';\n\t\t\t\t}\n\t\t\t\tindex++;\n\t\t\t\tconst formatter = createDebug.formatters[format];\n\t\t\t\tif (typeof formatter === 'function') {\n\t\t\t\t\tconst val = args[index];\n\t\t\t\t\tmatch = formatter.call(self, val);\n\n\t\t\t\t\t// Now we need to remove `args[index]` since it's inlined in the `format`\n\t\t\t\t\targs.splice(index, 1);\n\t\t\t\t\tindex--;\n\t\t\t\t}\n\t\t\t\treturn match;\n\t\t\t});\n\n\t\t\t// Apply env-specific formatting (colors, etc.)\n\t\t\tcreateDebug.formatArgs.call(self, args);\n\n\t\t\tconst logFn = self.log || createDebug.log;\n\t\t\tlogFn.apply(self, args);\n\t\t}\n\n\t\tdebug.namespace = namespace;\n\t\tdebug.useColors = createDebug.useColors();\n\t\tdebug.color = createDebug.selectColor(namespace);\n\t\tdebug.extend = extend;\n\t\tdebug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release.\n\n\t\tObject.defineProperty(debug, 'enabled', {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: false,\n\t\t\tget: () => {\n\t\t\t\tif (enableOverride !== null) {\n\t\t\t\t\treturn enableOverride;\n\t\t\t\t}\n\t\t\t\tif (namespacesCache !== createDebug.namespaces) {\n\t\t\t\t\tnamespacesCache = createDebug.namespaces;\n\t\t\t\t\tenabledCache = createDebug.enabled(namespace);\n\t\t\t\t}\n\n\t\t\t\treturn enabledCache;\n\t\t\t},\n\t\t\tset: v => {\n\t\t\t\tenableOverride = v;\n\t\t\t}\n\t\t});\n\n\t\t// Env-specific initialization logic for debug instances\n\t\tif (typeof createDebug.init === 'function') {\n\t\t\tcreateDebug.init(debug);\n\t\t}\n\n\t\treturn debug;\n\t}\n\n\tfunction extend(namespace, delimiter) {\n\t\tconst newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);\n\t\tnewDebug.log = this.log;\n\t\treturn newDebug;\n\t}\n\n\t/**\n\t* Enables a debug mode by namespaces. This can include modes\n\t* separated by a colon and wildcards.\n\t*\n\t* @param {String} namespaces\n\t* @api public\n\t*/\n\tfunction enable(namespaces) {\n\t\tcreateDebug.save(namespaces);\n\t\tcreateDebug.namespaces = namespaces;\n\n\t\tcreateDebug.names = [];\n\t\tcreateDebug.skips = [];\n\n\t\tconst split = (typeof namespaces === 'string' ? namespaces : '')\n\t\t\t.trim()\n\t\t\t.replace(/\\s+/g, ',')\n\t\t\t.split(',')\n\t\t\t.filter(Boolean);\n\n\t\tfor (const ns of split) {\n\t\t\tif (ns[0] === '-') {\n\t\t\t\tcreateDebug.skips.push(ns.slice(1));\n\t\t\t} else {\n\t\t\t\tcreateDebug.names.push(ns);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Checks if the given string matches a namespace template, honoring\n\t * asterisks as wildcards.\n\t *\n\t * @param {String} search\n\t * @param {String} template\n\t * @return {Boolean}\n\t */\n\tfunction matchesTemplate(search, template) {\n\t\tlet searchIndex = 0;\n\t\tlet templateIndex = 0;\n\t\tlet starIndex = -1;\n\t\tlet matchIndex = 0;\n\n\t\twhile (searchIndex < search.length) {\n\t\t\tif (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === '*')) {\n\t\t\t\t// Match character or proceed with wildcard\n\t\t\t\tif (template[templateIndex] === '*') {\n\t\t\t\t\tstarIndex = templateIndex;\n\t\t\t\t\tmatchIndex = searchIndex;\n\t\t\t\t\ttemplateIndex++; // Skip the '*'\n\t\t\t\t} else {\n\t\t\t\t\tsearchIndex++;\n\t\t\t\t\ttemplateIndex++;\n\t\t\t\t}\n\t\t\t} else if (starIndex !== -1) { // eslint-disable-line no-negated-condition\n\t\t\t\t// Backtrack to the last '*' and try to match more characters\n\t\t\t\ttemplateIndex = starIndex + 1;\n\t\t\t\tmatchIndex++;\n\t\t\t\tsearchIndex = matchIndex;\n\t\t\t} else {\n\t\t\t\treturn false; // No match\n\t\t\t}\n\t\t}\n\n\t\t// Handle trailing '*' in template\n\t\twhile (templateIndex < template.length && template[templateIndex] === '*') {\n\t\t\ttemplateIndex++;\n\t\t}\n\n\t\treturn templateIndex === template.length;\n\t}\n\n\t/**\n\t* Disable debug output.\n\t*\n\t* @return {String} namespaces\n\t* @api public\n\t*/\n\tfunction disable() {\n\t\tconst namespaces = [\n\t\t\t...createDebug.names,\n\t\t\t...createDebug.skips.map(namespace => '-' + namespace)\n\t\t].join(',');\n\t\tcreateDebug.enable('');\n\t\treturn namespaces;\n\t}\n\n\t/**\n\t* Returns true if the given mode name is enabled, false otherwise.\n\t*\n\t* @param {String} name\n\t* @return {Boolean}\n\t* @api public\n\t*/\n\tfunction enabled(name) {\n\t\tfor (const skip of createDebug.skips) {\n\t\t\tif (matchesTemplate(name, skip)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tfor (const ns of createDebug.names) {\n\t\t\tif (matchesTemplate(name, ns)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t* Coerce `val`.\n\t*\n\t* @param {Mixed} val\n\t* @return {Mixed}\n\t* @api private\n\t*/\n\tfunction coerce(val) {\n\t\tif (val instanceof Error) {\n\t\t\treturn val.stack || val.message;\n\t\t}\n\t\treturn val;\n\t}\n\n\t/**\n\t* XXX DO NOT USE. This is a temporary stub function.\n\t* XXX It WILL be removed in the next major release.\n\t*/\n\tfunction destroy() {\n\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t}\n\n\tcreateDebug.enable(createDebug.load());\n\n\treturn createDebug;\n}\n\nmodule.exports = setup;\n", "/* eslint-env browser */\n\n/**\n * This is the web browser implementation of `debug()`.\n */\n\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = localstorage();\nexports.destroy = (() => {\n\tlet warned = false;\n\n\treturn () => {\n\t\tif (!warned) {\n\t\t\twarned = true;\n\t\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t\t}\n\t};\n})();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n\t'#0000CC',\n\t'#0000FF',\n\t'#0033CC',\n\t'#0033FF',\n\t'#0066CC',\n\t'#0066FF',\n\t'#0099CC',\n\t'#0099FF',\n\t'#00CC00',\n\t'#00CC33',\n\t'#00CC66',\n\t'#00CC99',\n\t'#00CCCC',\n\t'#00CCFF',\n\t'#3300CC',\n\t'#3300FF',\n\t'#3333CC',\n\t'#3333FF',\n\t'#3366CC',\n\t'#3366FF',\n\t'#3399CC',\n\t'#3399FF',\n\t'#33CC00',\n\t'#33CC33',\n\t'#33CC66',\n\t'#33CC99',\n\t'#33CCCC',\n\t'#33CCFF',\n\t'#6600CC',\n\t'#6600FF',\n\t'#6633CC',\n\t'#6633FF',\n\t'#66CC00',\n\t'#66CC33',\n\t'#9900CC',\n\t'#9900FF',\n\t'#9933CC',\n\t'#9933FF',\n\t'#99CC00',\n\t'#99CC33',\n\t'#CC0000',\n\t'#CC0033',\n\t'#CC0066',\n\t'#CC0099',\n\t'#CC00CC',\n\t'#CC00FF',\n\t'#CC3300',\n\t'#CC3333',\n\t'#CC3366',\n\t'#CC3399',\n\t'#CC33CC',\n\t'#CC33FF',\n\t'#CC6600',\n\t'#CC6633',\n\t'#CC9900',\n\t'#CC9933',\n\t'#CCCC00',\n\t'#CCCC33',\n\t'#FF0000',\n\t'#FF0033',\n\t'#FF0066',\n\t'#FF0099',\n\t'#FF00CC',\n\t'#FF00FF',\n\t'#FF3300',\n\t'#FF3333',\n\t'#FF3366',\n\t'#FF3399',\n\t'#FF33CC',\n\t'#FF33FF',\n\t'#FF6600',\n\t'#FF6633',\n\t'#FF9900',\n\t'#FF9933',\n\t'#FFCC00',\n\t'#FFCC33'\n];\n\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\n// eslint-disable-next-line complexity\nfunction useColors() {\n\t// NB: In an Electron preload script, document will be defined but not fully\n\t// initialized. Since we know we're in Chrome, we'll just detect this case\n\t// explicitly\n\tif (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {\n\t\treturn true;\n\t}\n\n\t// Internet Explorer and Edge do not support colors.\n\tif (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\\/(\\d+)/)) {\n\t\treturn false;\n\t}\n\n\tlet m;\n\n\t// Is webkit? http://stackoverflow.com/a/16459606/376773\n\t// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n\t// eslint-disable-next-line no-return-assign\n\treturn (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||\n\t\t// Is firebug? http://stackoverflow.com/a/398120/376773\n\t\t(typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||\n\t\t// Is firefox >= v31?\n\t\t// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/)) && parseInt(m[1], 10) >= 31) ||\n\t\t// Double check webkit in userAgent just in case we are in a worker\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/));\n}\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n\targs[0] = (this.useColors ? '%c' : '') +\n\t\tthis.namespace +\n\t\t(this.useColors ? ' %c' : ' ') +\n\t\targs[0] +\n\t\t(this.useColors ? '%c ' : ' ') +\n\t\t'+' + module.exports.humanize(this.diff);\n\n\tif (!this.useColors) {\n\t\treturn;\n\t}\n\n\tconst c = 'color: ' + this.color;\n\targs.splice(1, 0, c, 'color: inherit');\n\n\t// The final \"%c\" is somewhat tricky, because there could be other\n\t// arguments passed either before or after the %c, so we need to\n\t// figure out the correct index to insert the CSS into\n\tlet index = 0;\n\tlet lastC = 0;\n\targs[0].replace(/%[a-zA-Z%]/g, match => {\n\t\tif (match === '%%') {\n\t\t\treturn;\n\t\t}\n\t\tindex++;\n\t\tif (match === '%c') {\n\t\t\t// We only are interested in the *last* %c\n\t\t\t// (the user may have provided their own)\n\t\t\tlastC = index;\n\t\t}\n\t});\n\n\targs.splice(lastC, 0, c);\n}\n\n/**\n * Invokes `console.debug()` when available.\n * No-op when `console.debug` is not a \"function\".\n * If `console.debug` is not available, falls back\n * to `console.log`.\n *\n * @api public\n */\nexports.log = console.debug || console.log || (() => {});\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\nfunction save(namespaces) {\n\ttry {\n\t\tif (namespaces) {\n\t\t\texports.storage.setItem('debug', namespaces);\n\t\t} else {\n\t\t\texports.storage.removeItem('debug');\n\t\t}\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\nfunction load() {\n\tlet r;\n\ttry {\n\t\tr = exports.storage.getItem('debug') || exports.storage.getItem('DEBUG') ;\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n\n\t// If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n\tif (!r && typeof process !== 'undefined' && 'env' in process) {\n\t\tr = process.env.DEBUG;\n\t}\n\n\treturn r;\n}\n\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\nfunction localstorage() {\n\ttry {\n\t\t// TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context\n\t\t// The Browser also has localStorage in the global context.\n\t\treturn localStorage;\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\nmodule.exports = require('./common')(exports);\n\nconst {formatters} = module.exports;\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nformatters.j = function (v) {\n\ttry {\n\t\treturn JSON.stringify(v);\n\t} catch (error) {\n\t\treturn '[UnexpectedJSONParseError]: ' + error.message;\n\t}\n};\n", "import { template as _$template } from \"solid-js/web\";\nimport { createComponent as _$createComponent } from \"solid-js/web\";\nimport { setAttribute as _$setAttribute } from \"solid-js/web\";\nimport { effect as _$effect } from \"solid-js/web\";\nimport { insert as _$insert } from \"solid-js/web\";\nimport { getOwner as _$getOwner } from \"solid-js/web\";\nvar _tmpl$ = /*#__PURE__*/_$template(`<patchwork-view component=patchwork-isolation root-component=threepane-isolation-root shared-providers=patchwork:contact,patchwork:selected-doc,patchwork:worker-channel shared-tools=llm-config-tray style=display:contents><script type=application/json data-root-component-data>`, true, false, false),\n _tmpl$2 = /*#__PURE__*/_$template(`<div class=frame>`);\nimport { createMemo } from \"solid-js\";\nimport { createStore, reconcile } from \"solid-js/store\";\nimport { render } from \"solid-js/web\";\nimport { DocumentAreaRoot } from \"./DocumentAreaRoot\";\nimport { DEFAULT_SIDEBAR_WIDTH } from \"../hooks\";\nimport { ensureFrameStyles } from \"../ensureFrameStyles\";\nexport function IsolatedDocumentArea(props) {\n const rootUrls = createMemo(() => {\n const urls = /* @__PURE__ */new Set();\n const selected = props.selectedDocUrl();\n if (selected) urls.add(selected);\n if (props.contactUrl) urls.add(props.contactUrl);\n return [...urls];\n });\n const propsJson = createMemo(() => JSON.stringify({\n selectedDocUrl: props.selectedDocUrl(),\n selectedToolId: props.selectedToolId(),\n doctitleSlots: props.doctitleSlots(),\n isLeftCollapsed: props.isLeftCollapsed(),\n initialRightWidth: props.initialRightWidth(),\n initialRightCollapsed: props.initialRightCollapsed()\n }));\n return (() => {\n var _el$ = _tmpl$(),\n _el$2 = _el$.firstChild;\n _el$._$owner = _$getOwner();\n _$insert(_el$2, propsJson);\n _$effect(() => _$setAttribute(_el$, \"automerge-allowlist\", rootUrls().join(\",\")));\n return _el$;\n })();\n}\nfunction parseProps(script) {\n if (!script?.textContent) return {};\n try {\n return JSON.parse(script.textContent);\n } catch (err) {\n console.error(\"[threepane-isolation-root] bad props JSON:\", err);\n return {};\n }\n}\nexport function mountIsolationRoot(element) {\n ensureFrameStyles();\n const script = element.querySelector('script[type=\"application/json\"]');\n const [p, setP] = createStore(parseProps(script));\n const observer = new MutationObserver(() => {\n setP(reconcile(parseProps(script)));\n });\n if (script) {\n observer.observe(script, {\n characterData: true,\n childList: true,\n subtree: true\n });\n }\n const dispose = render(() => (() => {\n var _el$3 = _tmpl$2();\n _$insert(_el$3, _$createComponent(DocumentAreaRoot, {\n selectedDocUrl: () => p.selectedDocUrl,\n selectedToolId: () => p.selectedToolId,\n doctitleSlots: () => p.doctitleSlots,\n isLeftCollapsed: () => p.isLeftCollapsed ?? false,\n initialRightWidth: () => p.initialRightWidth ?? DEFAULT_SIDEBAR_WIDTH,\n initialRightCollapsed: () => p.initialRightCollapsed ?? false\n }));\n return _el$3;\n })(), element);\n return () => {\n observer.disconnect();\n dispose();\n };\n}", "import { template as _$template } from \"solid-js/web\";\nimport { insert as _$insert } from \"solid-js/web\";\nimport { getOwner as _$getOwner } from \"solid-js/web\";\nimport { use as _$use } from \"solid-js/web\";\nimport { createComponent as _$createComponent } from \"solid-js/web\";\nvar _tmpl$ = /*#__PURE__*/_$template(`<patchwork-view component=patchwork-draft-state-provider>`, true, false, false),\n _tmpl$2 = /*#__PURE__*/_$template(`<div class=frame__main-column><div class=frame__doc-column><div class=main-area>`),\n _tmpl$3 = /*#__PURE__*/_$template(`<patchwork-view component=patchwork-draft-overlay-provider><patchwork-view component=patchwork-comments-provider><patchwork-view component=patchwork-focus-provider>`, true, false, false);\nimport { makePersisted } from \"@solid-primitives/storage\";\nimport { createEffect, createMemo, createSignal, on, onCleanup, onMount, Show } from \"solid-js\";\nimport { useProviderReady, useTaggedComponents, SIDEBAR_KEYS, COLLAPSE_CONTEXT_SIDEBAR_EVENT } from \"../hooks\";\nimport { useSidebarResize } from \"../hooks/useSidebarResize\";\nimport { FrameTopBar } from \"./FrameTopBar\";\nimport { ContextSidebar } from \"./ContextSidebar\";\nimport { MainDocumentView } from \"./MainDocumentView\";\nconst MIN_SIDEBAR_WIDTH = 180;\nconst MAX_SIDEBAR_WIDTH = 720;\nconst AUTO_CLOSE_WIDTH = 120;\nconst DRAG_THRESHOLD = 3;\nexport function DocumentAreaRoot(props) {\n const [isRightSidebarCollapsed, setIsRightSidebarCollapsed] = createSignal(props.initialRightCollapsed());\n const [rightSidebarWidth, setRightSidebarWidth] = createSignal(props.initialRightWidth());\n createEffect(on(isRightSidebarCollapsed, value => {\n try {\n localStorage.setItem(SIDEBAR_KEYS.rightCollapsed, String(value));\n } catch {}\n }, {\n defer: true\n }));\n createEffect(on(rightSidebarWidth, value => {\n try {\n localStorage.setItem(SIDEBAR_KEYS.rightWidth, String(value));\n } catch {}\n }, {\n defer: true\n }));\n const [, setUnusedLeftWidth] = createSignal(0);\n const [, setUnusedLeftCollapsed] = createSignal(false);\n const sidebarResize = useSidebarResize({\n setLeftSidebarWidth: setUnusedLeftWidth,\n setRightSidebarWidth,\n setIsSidebarCollapsed: setUnusedLeftCollapsed,\n setIsRightSidebarCollapsed,\n isLeftCollapsed: () => props.isLeftCollapsed(),\n isRightCollapsed: isRightSidebarCollapsed,\n minWidth: MIN_SIDEBAR_WIDTH,\n maxWidth: MAX_SIDEBAR_WIDTH,\n autoCloseWidth: AUTO_CLOSE_WIDTH,\n dragThreshold: DRAG_THRESHOLD\n });\n onMount(() => {\n const onCollapse = () => setIsRightSidebarCollapsed(true);\n window.addEventListener(COLLAPSE_CONTEXT_SIDEBAR_EVENT, onCollapse);\n onCleanup(() => window.removeEventListener(COLLAPSE_CONTEXT_SIDEBAR_EVENT, onCollapse));\n });\n const [selectedContextToolId, setSelectedContextToolId] = makePersisted(createSignal(), {\n name: SIDEBAR_KEYS.contextToolId\n });\n const [draftStateProviderHost, setDraftStateProviderHost] = createSignal();\n const isDraftStateProviderReady = useProviderReady(\"patchwork-draft-state-provider\", draftStateProviderHost);\n const readyDraftStateHost = () => isDraftStateProviderReady() ? draftStateProviderHost() : void 0;\n return _$createComponent(Show, {\n get when() {\n return props.selectedDocUrl();\n },\n keyed: true,\n children: docUrl => (() => {\n var _el$ = _tmpl$();\n _$use(setDraftStateProviderHost, _el$);\n _el$.docUrl = docUrl;\n _el$._$owner = _$getOwner();\n _$insert(_el$, _$createComponent(Show, {\n get when() {\n return readyDraftStateHost();\n },\n children: host => _$createComponent(DraftDocumentArea, {\n get host() {\n return host();\n },\n get setMainDocElement() {\n return props.setMainDocElement;\n },\n get selectedDocUrl() {\n return props.selectedDocUrl;\n },\n get selectedToolId() {\n return props.selectedToolId;\n },\n get doctitleSlots() {\n return props.doctitleSlots;\n },\n get isLeftCollapsed() {\n return props.isLeftCollapsed;\n },\n isRightSidebarCollapsed: isRightSidebarCollapsed,\n setIsRightSidebarCollapsed: setIsRightSidebarCollapsed,\n rightSidebarWidth: rightSidebarWidth,\n get handleMouseDown() {\n return sidebarResize.handleMouseDown;\n },\n get handleToggleClick() {\n return sidebarResize.handleToggleClick;\n },\n selectedContextToolId: selectedContextToolId,\n setSelectedContextToolId: setSelectedContextToolId\n })\n }));\n return _el$;\n })()\n });\n}\nfunction DraftDocumentArea(props) {\n const contextItems = useTaggedComponents(\"context-tool\");\n const hasContext = () => contextItems().length > 0;\n const mainViewKey = createMemo(() => props.selectedDocUrl());\n const [draftOverlayProviderHost, setDraftOverlayProviderHost] = createSignal();\n const isDraftOverlayProviderReady = useProviderReady(\"patchwork-draft-overlay-provider\", draftOverlayProviderHost);\n const [commentsProviderElement, setCommentsProviderElement] = createSignal();\n const isCommentsProviderReady = useProviderReady(\"patchwork-comments-provider\", commentsProviderElement);\n const [focusProviderElement, setFocusProviderElement] = createSignal();\n const isFocusProviderReady = useProviderReady(\"patchwork-focus-provider\", focusProviderElement);\n const areDocProvidersReady = createMemo(() => isDraftOverlayProviderReady() && isCommentsProviderReady() && isFocusProviderReady());\n return (() => {\n var _el$2 = _tmpl$3(),\n _el$3 = _el$2.firstChild,\n _el$4 = _el$3.firstChild;\n _$use(setDraftOverlayProviderHost, _el$2);\n _el$2._$owner = _$getOwner();\n _$use(setCommentsProviderElement, _el$3);\n _el$3._$owner = _$getOwner();\n _$use(setFocusProviderElement, _el$4);\n _el$4._$owner = _$getOwner();\n _$insert(_el$4, _$createComponent(Show, {\n get when() {\n return areDocProvidersReady();\n },\n get children() {\n var _el$5 = _tmpl$2(),\n _el$6 = _el$5.firstChild,\n _el$7 = _el$6.firstChild;\n _$insert(_el$6, _$createComponent(FrameTopBar, {\n get docUrl() {\n return props.selectedDocUrl;\n },\n get toolSlots() {\n return props.doctitleSlots;\n },\n get isLeftCollapsed() {\n return props.isLeftCollapsed;\n },\n hasContext: hasContext,\n get isRightCollapsed() {\n return props.isRightSidebarCollapsed;\n },\n onToggleRight: () => props.setIsRightSidebarCollapsed(v => !v)\n }), _el$7);\n _$insert(_el$7, _$createComponent(MainDocumentView, {\n viewKey: mainViewKey,\n get selectedDocUrl() {\n return props.selectedDocUrl;\n },\n get toolId() {\n return props.selectedToolId;\n },\n ref: el => props.setMainDocElement?.(el)\n }));\n _$insert(_el$5, _$createComponent(Show, {\n get when() {\n return hasContext();\n },\n get children() {\n return _$createComponent(ContextSidebar, {\n get selectedToolId() {\n return props.selectedContextToolId;\n },\n get setSelectedToolId() {\n return props.setSelectedContextToolId;\n },\n get isCollapsed() {\n return props.isRightSidebarCollapsed;\n },\n get width() {\n return props.rightSidebarWidth;\n },\n get onMouseDown() {\n return props.handleMouseDown;\n },\n get onToggleClick() {\n return props.handleToggleClick;\n },\n onCollapse: () => props.setIsRightSidebarCollapsed(true)\n });\n }\n }), null);\n return _el$5;\n }\n }));\n return _el$2;\n })();\n}", "import { createUniqueId, untrack } from \"solid-js\";\nimport { isServer, isDev } from \"solid-js/web\";\nimport { reconcile } from \"solid-js/store\";\nexport function makePersisted(signal, options = {}) {\n const storage = options.storage || globalThis.localStorage;\n const name = options.name || `storage-${createUniqueId()}`;\n if (!storage) {\n return Object.assign(signal, { 2: null });\n }\n const storageOptions = options.storageOptions;\n const serialize = options.serialize || JSON.stringify.bind(JSON);\n const deserialize = options.deserialize || JSON.parse.bind(JSON);\n const init = storage.getItem(name, storageOptions);\n const set = typeof signal[0] === \"function\"\n ? (data) => {\n try {\n const value = deserialize(data);\n signal[1](() => value);\n }\n catch (e) {\n // eslint-disable-next-line no-console\n if (isDev)\n console.warn(e);\n }\n }\n : (data) => {\n try {\n const value = deserialize(data);\n signal[1](reconcile(value));\n }\n catch (e) {\n // eslint-disable-next-line no-console\n if (isDev)\n console.warn(e);\n }\n };\n let unchanged = true;\n if (init instanceof Promise)\n init.then(data => unchanged && data && set(data));\n else if (init)\n set(init);\n if (typeof options.sync?.[0] === \"function\") {\n const get = typeof signal[0] === \"function\" ? signal[0] : () => signal[0];\n options.sync[0]((data) => {\n if (data.key !== name ||\n (!isServer && (data.url || globalThis.location.href) !== globalThis.location.href) ||\n data.newValue === serialize(untrack(get))) {\n return;\n }\n set(data.newValue);\n });\n }\n return Object.assign([], signal, {\n 1: typeof signal[0] === \"function\"\n ? (value) => {\n const output = signal[1](value);\n const serialized = value != null ? serialize(output) : value;\n options.sync?.[1](name, serialized);\n if (serialized != null)\n storage.setItem(name, serialized, storageOptions);\n else\n storage.removeItem(name, storageOptions);\n unchanged = false;\n return output;\n }\n : (...args) => {\n signal[1](...args);\n const value = untrack(() => serialize(signal[0]));\n options.sync?.[1](name, value);\n storage.setItem(name, value, storageOptions);\n unchanged = false;\n },\n 2: init,\n });\n}\n/**\n * storageSync - synchronize localStorage\n * This does only work for { storage: localStorage }.\n * If you wish to use e.g. cookieStorage, you may use a different sync method\n */\nexport const storageSync = [\n (subscriber) => window.addEventListener(\"storage\", ev => subscriber(ev)),\n () => {\n /*storage already sends events fulfilling the PersistenceSyncData<T> conditions*/\n },\n];\n/**\n * messageSync - synchronize over post message or broadcast channel API\n */\nexport const messageSync = (channel = window) => [\n (subscriber) => channel.addEventListener(\"message\", ev => {\n subscriber(ev.data);\n }),\n (key, newValue) => channel.postMessage({ key, newValue, timeStamp: +new Date(), url: location.href }, location.origin),\n];\n/**\n * wsSync - syncronize persisted storage via web socket\n */\nexport const wsSync = (ws, warnOnError = isDev) => [\n (subscriber) => ws.addEventListener(\"message\", (ev) => {\n try {\n const data = JSON.parse(ev.data);\n if ([\"key\", \"newValue\", \"timeStamp\"].every(item => Object.hasOwn(data, item))) {\n subscriber(data);\n }\n }\n catch (e) {\n // eslint-disable-next-line no-console\n if (warnOnError)\n console.warn(e);\n }\n }),\n (key, newValue) => ws.send(JSON.stringify({\n key,\n newValue,\n timeStamp: +new Date(),\n ...(isServer ? {} : { url: location.href }),\n })),\n];\n/**\n * multiplex arbitrary sync APIs\n *\n * ```ts\n * makePersisted(createSignal(0), { sync: multiplexSync(messageSync(bc), wsSync(ws)) })\n * ```\n */\nexport const multiplexSync = (...syncAPIs) => [\n subscriber => syncAPIs.forEach(([subscribe]) => subscribe(subscriber)),\n (key, value) => syncAPIs.forEach(([_, updater]) => updater(key, value)),\n];\n", "import { createEffect, createSignal, on } from \"solid-js\";\n\n/**\n * The localStorage keys for persisted sidebar state. Defined here, the canonical\n * sidebar-persistence module, and imported wherever sidebar state is read/written\n * (e.g. the isolated document-area root seeds + persists the right-sidebar keys),\n * so the key strings live in exactly one place.\n */\nexport const SIDEBAR_KEYS = {\n leftCollapsed: \"patchwork:leftSidebarCollapsed\",\n rightCollapsed: \"patchwork:rightSidebarCollapsed\",\n leftWidth: \"patchwork:leftSidebarWidth\",\n rightWidth: \"patchwork:rightSidebarWidth\",\n contextToolId: \"patchwork:contextSidebarToolId\",\n} as const;\n\n/**\n * DOM event (dispatched on `window`) asking the context (right) sidebar to\n * collapse. The left sidebar is host-owned and collapsed directly, but the\n * right-sidebar collapse state lives inside `DocumentAreaRoot` (so it survives\n * the isolation boundary), so the host signals it out-of-band through this event.\n */\nexport const COLLAPSE_CONTEXT_SIDEBAR_EVENT =\n \"patchwork:collapse-context-sidebar\";\n\n/** Default sidebar width (px) when nothing is persisted. */\nexport const DEFAULT_SIDEBAR_WIDTH = 400;\n\n/**\n * Reads a number from localStorage with a default fallback\n */\nexport function getStoredNumber(key: string, defaultValue: number): number {\n const stored = localStorage.getItem(key);\n return stored ? parseInt(stored, 10) : defaultValue;\n}\n\n/**\n * Reads a boolean from localStorage (returns true if value is \"true\")\n */\nexport function getStoredBoolean(key: string): boolean {\n return localStorage.getItem(key) === \"true\";\n}\n\n/**\n * Manages sidebar collapse and width state with localStorage persistence\n */\nexport function useSidebarState() {\n // Sidebar collapse state with localStorage persistence\n const [isSidebarCollapsed, setIsSidebarCollapsed] = createSignal(\n getStoredBoolean(SIDEBAR_KEYS.leftCollapsed)\n );\n const [isRightSidebarCollapsed, setIsRightSidebarCollapsed] = createSignal(\n getStoredBoolean(SIDEBAR_KEYS.rightCollapsed)\n );\n\n // Resizable sidebar width state with localStorage persistence\n const [leftSidebarWidth, setLeftSidebarWidth] = createSignal(\n getStoredNumber(SIDEBAR_KEYS.leftWidth, DEFAULT_SIDEBAR_WIDTH)\n );\n const [rightSidebarWidth, setRightSidebarWidth] = createSignal(\n getStoredNumber(SIDEBAR_KEYS.rightWidth, DEFAULT_SIDEBAR_WIDTH)\n );\n\n // Persist each sidebar state to localStorage independently\n createEffect(\n on(isSidebarCollapsed, (value) => {\n localStorage.setItem(SIDEBAR_KEYS.leftCollapsed, String(value));\n })\n );\n\n createEffect(\n on(isRightSidebarCollapsed, (value) => {\n localStorage.setItem(SIDEBAR_KEYS.rightCollapsed, String(value));\n })\n );\n\n createEffect(\n on(leftSidebarWidth, (value) => {\n localStorage.setItem(SIDEBAR_KEYS.leftWidth, String(value));\n })\n );\n\n createEffect(\n on(rightSidebarWidth, (value) => {\n localStorage.setItem(SIDEBAR_KEYS.rightWidth, String(value));\n })\n );\n\n return {\n isSidebarCollapsed,\n setIsSidebarCollapsed,\n isRightSidebarCollapsed,\n setIsRightSidebarCollapsed,\n leftSidebarWidth,\n setLeftSidebarWidth,\n rightSidebarWidth,\n setRightSidebarWidth,\n };\n}\n", "import { onCleanup, onMount } from \"solid-js\";\nimport type { Setter } from \"solid-js\";\n\ninterface UseSidebarResizeParams {\n setLeftSidebarWidth: Setter<number>;\n setRightSidebarWidth: Setter<number>;\n setIsSidebarCollapsed: Setter<boolean>;\n setIsRightSidebarCollapsed: Setter<boolean>;\n isLeftCollapsed: () => boolean;\n isRightCollapsed: () => boolean;\n minWidth: number;\n maxWidth: number;\n /** Drag narrower than this and the sidebar snaps closed (and re-opens once\n * dragged back out past it). */\n autoCloseWidth: number;\n dragThreshold: number;\n}\n\n/**\n * Manages sidebar resize and toggle interactions\n */\nexport function useSidebarResize({\n setLeftSidebarWidth,\n setRightSidebarWidth,\n setIsSidebarCollapsed,\n setIsRightSidebarCollapsed,\n isLeftCollapsed,\n isRightCollapsed,\n minWidth,\n maxWidth,\n autoCloseWidth,\n dragThreshold,\n}: UseSidebarResizeParams) {\n // Non-reactive refs for drag state\n let isResizing: \"left\" | \"right\" | null = null;\n let dragStartPos: { x: number; y: number } | null = null;\n let hasDragged = false;\n // The last *open* width applied during the live drag (null while the drag is\n // previewing a collapse). Read on release to decide whether to spring back.\n let lastDragWidth: number | null = null;\n\n const setWidth = (side: \"left\" | \"right\", w: number) =>\n side === \"left\" ? setLeftSidebarWidth(w) : setRightSidebarWidth(w);\n\n const setCollapsed = (side: \"left\" | \"right\", value: boolean) =>\n side === \"left\"\n ? setIsSidebarCollapsed(value)\n : setIsRightSidebarCollapsed(value);\n\n const isCollapsed = (side: \"left\" | \"right\") =>\n side === \"left\" ? isLeftCollapsed() : isRightCollapsed();\n\n // Apply a candidate width from a live drag. The panel tracks the pointer to\n // *any* size (Things 3 / nextaction feel) - it is allowed below `minWidth` so\n // you can see it shrink past the limit; the over-shrink is rejected later, on\n // release (see `settleDrag`). Below the auto-close threshold it snaps shut\n // live (so it reads as \"let go here and it stays closed\", and so the collapsed\n // 1px strip can be grabbed and dragged back open).\n const applyDragWidth = (side: \"left\" | \"right\", raw: number) => {\n if (raw < autoCloseWidth) {\n if (!isCollapsed(side)) setCollapsed(side, true);\n lastDragWidth = null;\n return;\n }\n if (isCollapsed(side)) setCollapsed(side, false);\n const w = Math.min(maxWidth, raw);\n setWidth(side, w);\n lastDragWidth = w;\n };\n\n // Decide the resting state when a drag ends. The width transition is live\n // again by now (the resizing flag was cleared in `endDrag`), so any width we\n // set here animates: if the drag finished too small (in the [auto-close, min)\n // band) the panel springs back out to `minWidth`; if it finished below\n // auto-close it already snapped collapsed during the drag, so we leave it.\n const settleDrag = (side: \"left\" | \"right\") => {\n if (isCollapsed(side)) return;\n if (lastDragWidth !== null && lastDragWidth < minWidth) {\n setWidth(side, minWidth);\n }\n };\n\n // A full-window overlay, added the moment a real drag begins. It keeps every\n // pointer event (and the resize cursor) on the parent document even as the\n // cursor passes over a tool iframe - otherwise the iframe swallows the\n // mousemove/mouseup and the drag can never end (\"you can't let go\"). It's\n // added lazily (not on mousedown) so a plain click still lands on the handle\n // and toggles collapse.\n let dragOverlay: HTMLDivElement | null = null;\n\n const beginDragVisuals = (side: \"left\" | \"right\") => {\n // suppress the width transition so the panel tracks the pointer 1:1, and tag\n // which side is dragging so the divider glow can extend up through the top\n // bar on that side (see `[data-sidebar-resizing]` rules in the stylesheet).\n document.body.setAttribute(\"data-sidebar-resizing\", side);\n dragOverlay = document.createElement(\"div\");\n dragOverlay.style.cssText =\n \"position:fixed;inset:0;z-index:2147483647;cursor:col-resize;\";\n document.body.appendChild(dragOverlay);\n };\n\n const endDrag = () => {\n isResizing = null;\n dragStartPos = null;\n document.body.style.userSelect = \"\";\n document.body.removeAttribute(\"data-sidebar-resizing\");\n dragOverlay?.remove();\n dragOverlay = null;\n };\n\n const handleMouseDown = (side: \"left\" | \"right\", e: MouseEvent) => {\n e.preventDefault();\n dragStartPos = { x: e.clientX, y: e.clientY };\n hasDragged = false;\n lastDragWidth = null;\n isResizing = side;\n document.body.style.userSelect = \"none\";\n };\n\n const handleMouseUp = () => {\n // Capture the drag state before endDrag() clears it, then resolve the\n // resting size with the width transition restored so spring-backs animate.\n const side = isResizing;\n const dragged = hasDragged;\n endDrag();\n if (side && dragged) settleDrag(side);\n };\n\n const handleMouseMove = (e: MouseEvent) => {\n if (!isResizing || !dragStartPos) return;\n\n // Once past the threshold this is a drag: drop the overlay in now, before\n // the cursor can reach any iframe, and suppress the width transition.\n const deltaX = Math.abs(e.clientX - dragStartPos.x);\n const deltaY = Math.abs(e.clientY - dragStartPos.y);\n if (!hasDragged && (deltaX > dragThreshold || deltaY > dragThreshold)) {\n hasDragged = true;\n beginDragVisuals(isResizing);\n }\n\n if (isResizing === \"left\") {\n applyDragWidth(\"left\", e.clientX);\n } else if (isResizing === \"right\") {\n applyDragWidth(\"right\", window.innerWidth - e.clientX);\n }\n };\n\n const handleToggleClick = (side: \"left\" | \"right\", e: MouseEvent) => {\n // Only toggle if we didn't drag\n if (hasDragged) {\n e.preventDefault();\n e.stopPropagation();\n // Reset the flag for next interaction\n hasDragged = false;\n return;\n }\n\n if (side === \"left\") {\n setIsSidebarCollapsed((prev) => !prev);\n } else {\n setIsRightSidebarCollapsed((prev) => !prev);\n }\n };\n\n onMount(() => {\n document.addEventListener(\"mousemove\", handleMouseMove);\n document.addEventListener(\"mouseup\", handleMouseUp);\n onCleanup(() => {\n document.removeEventListener(\"mousemove\", handleMouseMove);\n document.removeEventListener(\"mouseup\", handleMouseUp);\n // Reset body styles if component unmounts during drag\n if (isResizing) {\n endDrag();\n }\n });\n });\n\n return {\n handleMouseDown,\n handleToggleClick,\n };\n}\n", "import {\n createEffect,\n createSignal,\n onCleanup,\n type Accessor,\n} from \"solid-js\";\n\n/**\n * Tracks whether a `<patchwork-view>` provider has dispatched its\n * `patchwork:mounted` event yet, so callers can gate consumers that fire\n * `patchwork:request` events on the host listener being attached.\n *\n * The caller owns the element binding (typically a signal). Pass an accessor\n * that returns the current element; the effect re-runs whenever that element\n * changes and rewires the listener.\n */\nexport const useProviderReady = (\n componentId: string,\n element: Accessor<HTMLElement | undefined>\n): Accessor<boolean> => {\n const [isReady, setReady] = createSignal(false);\n\n createEffect(() => {\n const el = element();\n if (!el) return;\n setReady(false);\n const onMounted = (event: Event) => {\n const detail = (event as CustomEvent<{ componentId?: string }>).detail;\n if (detail?.componentId !== componentId) return;\n setReady(true);\n };\n el.addEventListener(\"patchwork:mounted\", onMounted);\n onCleanup(() => el.removeEventListener(\"patchwork:mounted\", onMounted));\n });\n\n return isReady;\n};\n", "import {\n createEffect,\n createSignal,\n onCleanup,\n type Accessor,\n} from \"solid-js\";\n\n// Safety net for the \"failed to mount\" case: a tool whose module throws sets\n// the view's internal state to \"error\" without dispatching any settling event,\n// so without this the sidebar would suspend forever. Long enough that a slow\n// (but healthy) load still wins the race and settles via its real event.\nconst MOUNT_TIMEOUT_MS = 5000;\n\n/**\n * Tracks whether the main document `<patchwork-view>` has settled *at least\n * once* \u2014 either it dispatched `patchwork:mounted` (a tool rendered) or\n * `patchwork:no-tool` (no tool could be resolved). Used to defer the sidebar\n * widgets until the main column has loaded, so the primary document wins the\n * initial render race.\n *\n * The result LATCHES: once true it stays true. We only want to win the *first*\n * render race \u2014 re-suspending on every later doc switch would tear down and\n * rebuild the widgets each time. So once settled we stop listening and never go\n * back to false.\n *\n * Both events bubble, so we listen on a stable container that wraps the view.\n * Events are filtered by url so a sidebar widget mounting inside the same\n * container can't settle us early.\n *\n * A timeout backs the explicit \"failed to mount\" case (see MOUNT_TIMEOUT_MS):\n * the view's error path emits no event, so without a fallback the widgets would\n * never appear.\n */\nexport const useMainDocMounted = (\n element: Accessor<HTMLElement | undefined>,\n docUrl: Accessor<string | undefined>\n): Accessor<boolean> => {\n const [isMounted, setMounted] = createSignal(false);\n\n createEffect(() => {\n // Latched: stop watching (and stop re-arming the timeout) once settled.\n if (isMounted()) return;\n const el = element();\n const url = docUrl();\n if (!el || !url) return;\n\n const onSettled = (event: Event) => {\n const detail = (event as CustomEvent<{ url?: string }>).detail;\n // `patchwork:mounted` for a doc view carries the url; ignore events for\n // other documents that happen to bubble through this container.\n if (detail?.url && detail.url !== url) return;\n setMounted(true);\n };\n\n el.addEventListener(\"patchwork:mounted\", onSettled);\n el.addEventListener(\"patchwork:no-tool\", onSettled);\n const timer = setTimeout(() => setMounted(true), MOUNT_TIMEOUT_MS);\n\n onCleanup(() => {\n el.removeEventListener(\"patchwork:mounted\", onSettled);\n el.removeEventListener(\"patchwork:no-tool\", onSettled);\n clearTimeout(timer);\n });\n });\n\n return isMounted;\n};\n", "import {\n getRegistry,\n type ToolDescription,\n} from \"@inkandswitch/patchwork-plugins\";\nimport { createMemo, createSignal, onCleanup, type Accessor } from \"solid-js\";\n\nexport type TaggedComponent = {\n id: string;\n name: string;\n icon?: string;\n};\n\n/**\n * Live, registry-driven list of every `patchwork:component` carrying `tag`\n * (e.g. `\"context-tool\"` or `\"system-tray\"`), sorted by name. A component just\n * declares its tag and shows up everywhere that tag is rendered.\n *\n * Reactive to the registry's `\"changed\"` event, so a late-registering or\n * hot-reloaded plugin appears without a remount. Safe to call from inside the\n * isolated iframe realm too \u2014 it mounts the same plugin set as the host (see\n * `registry.start` in `isolation/src/boot/iframe/main.ts`), so each realm\n * resolves its own local, equivalent list.\n */\nexport function useTaggedComponents(tag: string): Accessor<TaggedComponent[]> {\n const registry = getRegistry<ToolDescription>(\"patchwork:component\");\n\n const [version, setVersion] = createSignal(0);\n const off = registry.on(\"changed\", () => setVersion((v) => v + 1));\n onCleanup(off);\n\n return createMemo(() => {\n version();\n return (registry.all?.() ?? [])\n .filter((description) => (description.tags ?? []).includes(tag))\n .map((description) => ({\n id: description.id,\n name: description.name || description.id,\n icon: description.icon,\n }))\n .sort((a, b) => a.name.localeCompare(b.name));\n });\n}\n", "import { template as _$template } from \"solid-js/web\";\nimport { delegateEvents as _$delegateEvents } from \"solid-js/web\";\nimport { setStyleProperty as _$setStyleProperty } from \"solid-js/web\";\nimport { effect as _$effect } from \"solid-js/web\";\nimport { memo as _$memo } from \"solid-js/web\";\nimport { addEventListener as _$addEventListener } from \"solid-js/web\";\nimport { insert as _$insert } from \"solid-js/web\";\nvar _tmpl$ = /*#__PURE__*/_$template(`<div class=debug-registry-toast><div class=debug-registry-toast__header><span class=debug-registry-toast__title>\uD83D\uDD27 Registry (<!>)</span><button class=debug-registry-toast__clear title=\"Clear all\">\u2715</button></div><div class=debug-registry-toast__list>`),\n _tmpl$2 = /*#__PURE__*/_$template(`<div class=debug-registry-toast__item><div class=debug-registry-toast__content><span class=debug-registry-toast__event-type></span><span class=debug-registry-toast__plugin-type>`),\n _tmpl$3 = /*#__PURE__*/_$template(`<span class=debug-registry-toast__plugin-id>`);\nimport { createEffect, createSignal, onCleanup } from \"solid-js\";\nimport { getAllRegistries } from \"@inkandswitch/patchwork-plugins\";\nconst DEBUG_MODAL_KEY = \"debugModal\";\nexport function isDebugModalEnabled() {\n try {\n return localStorage.getItem(DEBUG_MODAL_KEY) === \"true\";\n } catch {\n return false;\n }\n}\nexport function setDebugModalEnabled(enabled) {\n try {\n if (enabled) {\n localStorage.setItem(DEBUG_MODAL_KEY, \"true\");\n } else {\n localStorage.removeItem(DEBUG_MODAL_KEY);\n }\n } catch {}\n}\nconst DEFAULT_EVENTS = [\"changed\"];\nexport function useDebugRegistryToast(options = {}) {\n const {\n events: subscribedEvents = DEFAULT_EVENTS\n } = options;\n const [events, setEvents] = createSignal([]);\n const [isEnabled, setIsEnabled] = createSignal(isDebugModalEnabled());\n const timeouts = /* @__PURE__ */new Set();\n const addEvent = (type, event, pluginId, pluginName) => {\n const newEvent = {\n id: crypto.randomUUID(),\n type,\n event,\n pluginId,\n pluginName,\n timestamp: Date.now()\n };\n setEvents(prev => {\n const updated = [newEvent, ...prev].slice(0, 50);\n return updated;\n });\n const timeoutId = setTimeout(() => {\n setEvents(prev => prev.filter(e => e.id !== newEvent.id));\n timeouts.delete(timeoutId);\n }, 5e3);\n timeouts.add(timeoutId);\n };\n const dismissEvent = eventId => {\n setEvents(prev => prev.filter(e => e.id !== eventId));\n };\n const clearAll = () => {\n setEvents([]);\n };\n createEffect(() => {\n if (!isEnabled()) {\n setEvents([]);\n timeouts.forEach(id => clearTimeout(id));\n timeouts.clear();\n return;\n }\n const registries = getAllRegistries();\n const unsubscribes = [];\n const lastPluginInfo = /* @__PURE__ */new Map();\n registries.forEach((registry, type) => {\n const trackRegistered = registry.on(\"registered\", plugin => {\n lastPluginInfo.set(type, {\n id: plugin.id,\n name: plugin.name,\n action: \"registered\"\n });\n if (subscribedEvents.includes(\"registered\")) {\n addEvent(type, \"registered\", plugin.id, plugin.name);\n }\n });\n unsubscribes.push(trackRegistered);\n const trackLoaded = registry.on(\"loaded\", plugin => {\n lastPluginInfo.set(type, {\n id: plugin.id,\n name: plugin.name,\n action: \"loaded\"\n });\n if (subscribedEvents.includes(\"loaded\")) {\n addEvent(type, \"loaded\", plugin.id, plugin.name);\n }\n });\n unsubscribes.push(trackLoaded);\n const trackRemoved = registry.on(\"removed\", id => {\n lastPluginInfo.set(type, {\n id,\n action: \"removed\"\n });\n if (subscribedEvents.includes(\"removed\")) {\n addEvent(type, \"removed\", id);\n }\n });\n unsubscribes.push(trackRemoved);\n if (subscribedEvents.includes(\"changed\")) {\n const unsub = registry.on(\"changed\", () => {\n const info = lastPluginInfo.get(type);\n addEvent(type, \"changed\", info?.id, info?.name);\n lastPluginInfo.delete(type);\n });\n unsubscribes.push(unsub);\n }\n });\n onCleanup(() => {\n unsubscribes.forEach(unsub => unsub());\n timeouts.forEach(id => clearTimeout(id));\n timeouts.clear();\n });\n });\n createEffect(() => {\n const handleStorageChange = e => {\n if (e.key === DEBUG_MODAL_KEY) {\n setIsEnabled(e.newValue === \"true\");\n }\n };\n window.addEventListener(\"storage\", handleStorageChange);\n onCleanup(() => window.removeEventListener(\"storage\", handleStorageChange));\n });\n return {\n events,\n isEnabled,\n setIsEnabled: enabled => {\n setDebugModalEnabled(enabled);\n setIsEnabled(enabled);\n },\n dismissEvent,\n clearAll\n };\n}\nexport function DebugRegistryToast({\n events,\n onDismiss,\n onClearAll\n}) {\n if (events.length === 0) return null;\n const eventColor = event => {\n switch (event) {\n case \"registered\":\n return \"var(--debug-toast-registered, #3b82f6)\";\n case \"loaded\":\n return \"var(--debug-toast-loaded, #22c55e)\";\n case \"removed\":\n return \"var(--debug-toast-removed, #ef4444)\";\n case \"changed\":\n return \"var(--debug-toast-changed, #f59e0b)\";\n }\n };\n return (() => {\n var _el$ = _tmpl$(),\n _el$2 = _el$.firstChild,\n _el$3 = _el$2.firstChild,\n _el$4 = _el$3.firstChild,\n _el$6 = _el$4.nextSibling,\n _el$5 = _el$6.nextSibling,\n _el$7 = _el$3.nextSibling,\n _el$8 = _el$2.nextSibling;\n _$insert(_el$3, () => events.length, _el$6);\n _$addEventListener(_el$7, \"click\", onClearAll, true);\n _$insert(_el$8, () => events.map(event => (() => {\n var _el$9 = _tmpl$2(),\n _el$0 = _el$9.firstChild,\n _el$1 = _el$0.firstChild,\n _el$10 = _el$1.nextSibling;\n _el$9.$$click = () => onDismiss(event.id);\n _$insert(_el$1, () => event.event);\n _$insert(_el$10, () => event.type);\n _$insert(_el$0, (() => {\n var _c$ = _$memo(() => !!event.pluginId);\n return () => _c$() && (() => {\n var _el$11 = _tmpl$3();\n _$insert(_el$11, () => event.pluginId);\n return _el$11;\n })();\n })(), null);\n _$effect(_$p => _$setStyleProperty(_el$9, \"border-left-color\", eventColor(event.event)));\n return _el$9;\n })()));\n return _el$;\n })();\n}\n_$delegateEvents([\"click\"]);", "import { template as _$template } from \"solid-js/web\";\nimport { delegateEvents as _$delegateEvents } from \"solid-js/web\";\nimport { getOwner as _$getOwner } from \"solid-js/web\";\nimport { effect as _$effect } from \"solid-js/web\";\nimport { setAttribute as _$setAttribute } from \"solid-js/web\";\nimport { memo as _$memo } from \"solid-js/web\";\nimport { insert as _$insert } from \"solid-js/web\";\nimport { createComponent as _$createComponent } from \"solid-js/web\";\nvar _tmpl$ = /*#__PURE__*/_$template(`<div class=threepane__title>`),\n _tmpl$2 = /*#__PURE__*/_$template(`<div class=threepane__doctitle-tools>`),\n _tmpl$3 = /*#__PURE__*/_$template(`<button type=button class=frame__sidebar-toggle title=\"Show context sidebar\"aria-label=\"Show context sidebar\">`),\n _tmpl$4 = /*#__PURE__*/_$template(`<div class=frame__topbar><div class=threepane__spacer>`),\n _tmpl$5 = /*#__PURE__*/_$template(`<patchwork-view>`, true, false, false);\nimport { For, Show } from \"solid-js\";\nimport { DocumentTitle } from \"./DocumentTitle\";\nimport { PanelRightIcon } from \"./ContextSidebar\";\nimport { slotId } from \"./SlotView\";\nexport function FrameTopBar(props) {\n const docToolSlots = () => props.toolSlots() ?? [];\n return (() => {\n var _el$ = _tmpl$4(),\n _el$3 = _el$.firstChild;\n _$insert(_el$, _$createComponent(Show, {\n get when() {\n return props.docUrl();\n },\n get children() {\n var _el$2 = _tmpl$();\n _$insert(_el$2, _$createComponent(DocumentTitle, {\n get docUrl() {\n return props.docUrl;\n }\n }));\n return _el$2;\n }\n }), _el$3);\n _$insert(_el$, _$createComponent(Show, {\n get when() {\n return _$memo(() => !!props.docUrl())() && docToolSlots().length;\n },\n get children() {\n var _el$4 = _tmpl$2();\n _$insert(_el$4, _$createComponent(For, {\n get each() {\n return docToolSlots();\n },\n children: slot => (() => {\n var _el$6 = _tmpl$5();\n _el$6._$owner = _$getOwner();\n _$effect(_p$ => {\n var _v$ = slotId(slot),\n _v$2 = props.docUrl();\n _v$ !== _p$.e && (_el$6.toolId = _p$.e = _v$);\n _v$2 !== _p$.t && (_el$6.docUrl = _p$.t = _v$2);\n return _p$;\n }, {\n e: undefined,\n t: undefined\n });\n return _el$6;\n })()\n }));\n return _el$4;\n }\n }), null);\n _$insert(_el$, _$createComponent(Show, {\n get when() {\n return _$memo(() => !!props.hasContext())() && props.isRightCollapsed();\n },\n get children() {\n var _el$5 = _tmpl$3();\n _el$5.$$click = () => props.onToggleRight();\n _$setAttribute(_el$5, \"aria-pressed\", false);\n _$insert(_el$5, _$createComponent(PanelRightIcon, {}));\n return _el$5;\n }\n }), null);\n _$effect(() => _el$.classList.toggle(\"frame__topbar--left-collapsed\", !!props.isLeftCollapsed()));\n return _el$;\n })();\n}\n_$delegateEvents([\"click\"]);", "import { template as _$template } from \"solid-js/web\";\nimport { delegateEvents as _$delegateEvents } from \"solid-js/web\";\nimport { setAttribute as _$setAttribute } from \"solid-js/web\";\nimport { insert as _$insert } from \"solid-js/web\";\nimport { memo as _$memo } from \"solid-js/web\";\nimport { effect as _$effect } from \"solid-js/web\";\nimport { use as _$use } from \"solid-js/web\";\nimport { createComponent as _$createComponent } from \"solid-js/web\";\nvar _tmpl$ = /*#__PURE__*/_$template(`<span class=threepane__title-text>`),\n _tmpl$2 = /*#__PURE__*/_$template(`<input class=threepane__title-input type=text>`);\nimport { useDocument } from \"solid-automerge\";\nimport { getType } from \"@inkandswitch/patchwork-filesystem\";\nimport { getRegistry, isLoadedPlugin } from \"@inkandswitch/patchwork-plugins\";\nimport { createEffect, createMemo, createSignal, onCleanup, onMount, Show } from \"solid-js\";\nexport function DocumentTitle(props) {\n let anchor;\n const [repo, setRepo] = createSignal();\n onMount(() => {\n setRepo(anchor.closest(\"repo-provider\")?.repo);\n });\n return _$createComponent(Show, {\n get when() {\n return repo();\n },\n get fallback() {\n return (() => {\n var _el$ = _tmpl$();\n var _ref$ = anchor;\n typeof _ref$ === \"function\" ? _$use(_ref$, _el$) : anchor = _el$;\n return _el$;\n })();\n },\n children: resolvedRepo => _$createComponent(DocumentTitleInner, {\n get docUrl() {\n return props.docUrl;\n },\n get repo() {\n return resolvedRepo();\n }\n })\n });\n}\nfunction DocumentTitleInner(props) {\n const [doc, handle] = useDocument(() => props.docUrl(), {\n repo: props.repo\n });\n const registry = getRegistry(\"patchwork:datatype\");\n const [registryVersion, setRegistryVersion] = createSignal(0);\n onMount(() => {\n const off = registry.on(\"changed\", () => setRegistryVersion(v => v + 1));\n onCleanup(off);\n });\n const typeId = createMemo(() => {\n const d = doc();\n return d ? getType(d) : void 0;\n });\n createEffect(() => {\n const id = typeId();\n if (id) void registry.load(id);\n });\n const datatype = createMemo(() => {\n registryVersion();\n const id = typeId();\n if (!id) return void 0;\n const dt = registry.get(id);\n return dt && isLoadedPlugin(dt) ? dt : void 0;\n });\n const title = createMemo(() => {\n const d = doc();\n const dt = datatype();\n if (!d || !dt) return void 0;\n return dt.module.getTitle(d);\n });\n const canEdit = createMemo(() => !!handle() && typeof datatype()?.module.setTitle === \"function\");\n const [editing, setEditing] = createSignal(false);\n let inputRef;\n function startEditing() {\n if (!canEdit()) return;\n setEditing(true);\n queueMicrotask(() => {\n inputRef?.focus();\n inputRef?.select();\n });\n }\n function commit(save) {\n if (!editing()) return;\n setEditing(false);\n if (!save) return;\n const next = inputRef?.value.trim();\n if (!next || next === title()) return;\n const h = handle();\n const setTitle = datatype()?.module.setTitle;\n if (!h || !setTitle) return;\n h.change(d => {\n setTitle(d, next);\n const meta = d[\"@patchwork\"];\n if (meta) meta.title = next;\n });\n }\n return _$createComponent(Show, {\n get when() {\n return editing();\n },\n get fallback() {\n return (() => {\n var _el$3 = _tmpl$();\n _el$3.$$click = startEditing;\n _$insert(_el$3, () => title() ?? \"Untitled\");\n _$effect(_p$ => {\n var _v$ = !!canEdit(),\n _v$2 = canEdit() ? \"Rename\" : void 0;\n _v$ !== _p$.e && _el$3.classList.toggle(\"threepane__title-text--editable\", _p$.e = _v$);\n _v$2 !== _p$.t && _$setAttribute(_el$3, \"title\", _p$.t = _v$2);\n return _p$;\n }, {\n e: undefined,\n t: undefined\n });\n return _el$3;\n })();\n },\n get children() {\n var _el$2 = _tmpl$2();\n _el$2.$$keydown = e => {\n if (e.key === \"Enter\") {\n e.preventDefault();\n commit(true);\n } else if (e.key === \"Escape\") {\n e.preventDefault();\n commit(false);\n }\n };\n _el$2.addEventListener(\"blur\", () => commit(true));\n var _ref$2 = inputRef;\n typeof _ref$2 === \"function\" ? _$use(_ref$2, _el$2) : inputRef = _el$2;\n _$effect(() => _el$2.value = title() ?? \"\");\n return _el$2;\n }\n });\n}\n_$delegateEvents([\"keydown\", \"click\"]);", "// cabbages.ts\nimport debug from \"debug\";\nvar log = debug(\"cabbages\");\nfunction pojo(target) {\n return typeof target == \"object\" && typeof target != null && Object.getPrototypeOf(target) == Object.prototype;\n}\nvar BLOCK_MARKER = \"\\uFFFC\";\nfunction apply(target, ...rest) {\n if (rest.length == 0) {\n log(\"empty patch\");\n return;\n }\n const [path, range, val] = rest;\n let p = [...path];\n while (true) {\n let key = p.shift();\n if (!p.length) {\n const RANGE_ARRAY = Array.isArray(range);\n if (pojo(target) && RANGE_ARRAY && typeof key == \"undefined\" && typeof range[0] == \"string\") {\n delete target[range[0]];\n return;\n }\n if (RANGE_ARRAY || typeof range == \"number\") {\n if (typeof key == \"undefined\") {\n throw new Error(\"cant treat top level as a seq\");\n }\n key = key;\n let [start, end] = Array.isArray(range) ? range : [range, range + 1];\n const ZERO_LENGTH = Array.isArray(range) && range.length == 0;\n if (!ZERO_LENGTH && (start == null || end == null)) {\n throw new RangeError(\"it's all or nothing, no half measures\");\n }\n const DELETE = typeof val == \"undefined\";\n const INSERT = start === end && !DELETE;\n const APPEND = ZERO_LENGTH && !DELETE;\n const REPLACE = !INSERT && !DELETE && !APPEND;\n if (typeof target[key] == \"undefined\") {\n if (typeof target == \"string\") {\n return;\n } else if (typeof val == \"string\") {\n target[key] = \"\";\n } else {\n target[key] = [];\n }\n }\n let seq = target[key];\n if (Array.isArray(seq)) {\n if (APPEND) {\n Array.isArray(val) ? seq.push(...val) : seq.push(val);\n return;\n }\n if (INSERT || REPLACE) {\n Array.isArray(val) ? seq.splice(start, end - start, ...val) : seq.splice(start, end - start, val);\n return;\n }\n if (DELETE) {\n seq.splice(start, end - start);\n return;\n }\n throw new Error(\"i don't know what happened\");\n }\n if (typeof seq == \"string\") {\n if (APPEND) {\n target[key] = seq + val;\n return;\n }\n if (REPLACE || INSERT) {\n target[key] = seq.slice(0, start) + (typeof val == \"string\" ? val : val.map(\n (n) => typeof n == \"string\" ? n : BLOCK_MARKER\n ).join(\"\")) + seq.slice(end);\n return;\n }\n if (DELETE) {\n target[key] = seq.slice(0, start) + seq.slice(end);\n return;\n }\n throw new Error(\"i don't know what happened\");\n }\n if (pojo(seq) && RANGE_ARRAY && typeof range[0] == \"string\") {\n delete seq[range[0]];\n return;\n }\n throw new Error(\"not implemented\");\n }\n if (typeof key == \"undefined\") {\n if (typeof range != \"string\") {\n throw new Error(`can't index top-level map with ${range}`);\n }\n if (typeof val == \"undefined\") {\n delete target[range];\n } else {\n target[range] = val;\n }\n return;\n }\n if (typeof target[key] == \"undefined\") {\n target[key] = {};\n }\n if (RANGE_ARRAY) {\n let [a, b] = range;\n if (a != null && b != null) {\n if (typeof val == \"undefined\" && a != null && b != null) {\n delete target[key][a || b];\n } else {\n target[key][a || b] = val;\n }\n }\n } else {\n if (typeof val == \"undefined\") {\n delete target[key][range];\n } else if (typeof target[key] == \"string\") {\n return;\n } else {\n target[key][range] = val;\n }\n }\n return;\n }\n if (typeof key == \"undefined\") {\n throw new Error(\"cant treat top level as a seq\");\n }\n key = key;\n let nextkey = p[0];\n if (typeof target[key] == \"undefined\") {\n if (typeof nextkey == \"string\") {\n target[key] = {};\n } else if (typeof nextkey == \"number\") {\n target[key] = [];\n } else {\n throw new Error(`can't go down this road ${target}.${key}.${nextkey}`);\n }\n }\n target = target[key];\n }\n}\nvar patch = apply;\nfunction get(obj, key) {\n for (let p = 0; p < key.length; p++) {\n obj = obj ? obj[key[p]] : void 0;\n }\n return obj;\n}\nfunction fromAutomerge(autopatch, payload) {\n const path = autopatch.path.slice(0, -1);\n const key = autopatch.path[autopatch.path.length - 1];\n switch (autopatch.action) {\n case \"mark\":\n case \"unmark\":\n log(\n `skipping ${autopatch.action} because it doesn't affect material reality`\n );\n return [];\n case \"inc\":\n if (payload) {\n return [path, key, get(payload.patchInfo.after, autopatch.path)];\n } else {\n throw new Error(\n `can't apply ${autopatch.action} without payload argument`\n );\n }\n case \"conflict\":\n if (payload) {\n return [path, key, get(payload.patchInfo.after, autopatch.path)];\n } else {\n throw new Error(\n `can't apply ${autopatch.action} without payload argument`\n );\n }\n case \"del\": {\n return typeof key == \"string\" ? [path, key] : [path, [key, key + (autopatch.length || 1)]];\n }\n case \"insert\": {\n return [\n path,\n [key, key],\n structuredClone(autopatch.values)\n ];\n }\n case \"splice\": {\n return [path, [key, key], [autopatch.value]];\n }\n case \"put\": {\n return [path, key, structuredClone(autopatch.value)];\n }\n }\n}\nexport {\n apply,\n fromAutomerge,\n patch,\n pojo\n};\n", "import type {DocHandleChangePayload} from \"@automerge/automerge-repo/slim\"\nimport {apply, fromAutomerge} from \"cabbages\"\n\n/**\n * convert automerge patches to solid producer operations\n * @param payload the\n * [DocHandleChangePayload](https://automerge.org/automerge-repo/interfaces/_automerge_automerge_repo.DocHandleChangePayload.html)\n * from the handle.on(\"change\n * @returns a callback for an immer-like function. e.g.\n * [produce](https://docs.solidjs.com/reference/store-utilities/produce) for\n * [Solid\n * Stores](https://docs.solidjs.com/reference/store-utilities/create-store)\n */\nexport default function autoproduce<T>(\n\tpayload: DocHandleChangePayload<T>\n): (doc: T) => void {\n\treturn (doc: T) => {\n\t\tfor (let patch of payload.patches) {\n\t\t\tapply(doc, ...fromAutomerge(patch, payload))\n\t\t}\n\t}\n}\n", "import {createMemo, type Accessor} from \"solid-js\"\nimport {type DocHandle, type Doc} from \"@automerge/automerge-repo/slim\"\nimport makeDocumentProjection from \"./makeDocumentProjection.ts\"\nimport {access} from \"@solid-primitives/utils\"\n\n/**\n * get a fine-grained live view of a document from a handle. works with\n * {@link useDocHandle}.\n * @param handle an accessor (signal/resource) of a\n * [DocHandle](https://automerge.org/automerge-repo/classes/_automerge_automerge_repo.DocHandle.html)\n */\nexport default function createDocumentProjection<T extends object>(\n\thandle: Accessor<DocHandle<T> | undefined>\n): Accessor<Doc<T> | undefined> {\n\tconst projection = createMemo<Doc<T> | undefined>(\n\t\t() => access(handle) && makeDocumentProjection<T>(access(handle)!)\n\t)\n\treturn projection\n}\n", "import {onCleanup} from \"solid-js\"\nimport type {\n\tDoc,\n\tDocHandle,\n\tDocHandleChangePayload,\n} from \"@automerge/automerge-repo/slim\"\nimport autoproduce from \"./autoproduce.ts\"\nimport {createStore, produce, reconcile, type Store} from \"solid-js/store\"\n\nconst cache = new WeakMap<\n\tDocHandle<unknown>,\n\t{\n\t\trefs: number\n\t\tstore: Store<Doc<unknown>>\n\t\tcleanup(): void\n\t}\n>()\n\n/**\n * make a fine-grained live view of a document from its handle.\n * @param handle an Automerge\n * [DocHandle](https://automerge.org/automerge-repo/classes/_automerge_automerge_repo.DocHandle.html)\n */\nexport default function makeDocumentProjection<T extends object>(\n\thandle: DocHandle<T>\n): Doc<T> {\n\tonCleanup(() => {\n\t\tconst item = cache.get(handle)!\n\t\tif (!item) return\n\t\tif (!item.refs--) {\n\t\t\titem.cleanup()\n\t\t}\n\t})\n\n\tif (cache.has(handle)) {\n\t\tconst item = cache.get(handle)!\n\t\titem.refs++\n\t\treturn item.store as Doc<T>\n\t}\n\n\tconst [doc, set] = createStore<Doc<T>>(structuredClone(handle.doc()!))\n\n\tcache.set(handle, {\n\t\trefs: 0,\n\t\tstore: doc,\n\t\tcleanup() {\n\t\t\thandle.off(\"change\", patch)\n\t\t\thandle.off(\"delete\", ondelete)\n\t\t\tcache.delete(handle)\n\t\t},\n\t})\n\n\tfunction patch(payload: DocHandleChangePayload<T>) {\n\t\t// `scopeReplaced` means the change landed at or above this (sub-)handle's\n\t\t// scope boundary, so it can't be expressed as in-scope patches. The\n\t\t// payload still carries `doc` \u2014 the new value at the handle's path (the\n\t\t// part of the store this scope points at) \u2014 so we reconcile against that\n\t\t// instead of applying patches. `reconcile` structurally diffs it against\n\t\t// the current store, so unchanged subtrees keep their identity and only\n\t\t// the parts that actually changed notify. `doc` is undefined when the\n\t\t// scope was removed entirely.\n\t\tif (payload.scopeReplaced) {\n\t\t\tset(reconcile((payload.doc ?? {}) as Doc<T>))\n\t\t\treturn\n\t\t}\n\t\tset(produce(autoproduce(payload)))\n\t}\n\n\tfunction ondelete() {\n\t\tset(reconcile({} as Doc<T>))\n\t}\n\n\thandle.on(\"change\", patch)\n\thandle.on(\"delete\", ondelete)\n\n\thandle.whenReady().then(() => {\n\t\tset(structuredClone(handle.doc()!))\n\t})\n\n\treturn doc\n}\n", "import { getOwner, onCleanup, createSignal, untrack, sharedConfig, onMount, DEV, equalFn, } from \"solid-js\";\nimport { isServer } from \"solid-js/web\";\nexport * from \"./types.js\";\n//\n// GENERAL HELPERS:\n//\nexport { isServer };\nexport const isClient = !isServer;\nexport const isDev = isClient && !!DEV;\nexport const isProd = !isDev;\n/** no operation */\nexport const noop = (() => void 0);\nexport const trueFn = () => true;\nexport const falseFn = () => false;\n/** @deprecated use {@link equalFn} from \"solid-js\" */\nexport const defaultEquals = equalFn;\nexport const EQUALS_FALSE_OPTIONS = { equals: false };\nexport const INTERNAL_OPTIONS = { internal: true };\n/**\n * Check if the value is an instance of ___\n */\nexport const ofClass = (v, c) => v instanceof c || (v && v.constructor === c);\n/** Check if value is typeof \"object\" or \"function\" */\nexport function isObject(value) {\n return value !== null && (typeof value === \"object\" || typeof value === \"function\");\n}\nexport const isNonNullable = (i) => i != null;\nexport const filterNonNullable = (arr) => arr.filter(isNonNullable);\nexport const compare = (a, b) => (a < b ? -1 : a > b ? 1 : 0);\n/**\n * Check shallow array equality\n */\nexport const arrayEquals = (a, b) => a === b || (a.length === b.length && a.every((e, i) => e === b[i]));\n/**\n * Returns a function that will call all functions in the order they were chained with the same arguments.\n */\nexport function chain(callbacks) {\n return (...args) => {\n for (const callback of callbacks)\n callback && callback(...args);\n };\n}\n/**\n * Returns a function that will call all functions in the reversed order with the same arguments.\n */\nexport function reverseChain(callbacks) {\n return (...args) => {\n for (let i = callbacks.length - 1; i >= 0; i--) {\n const callback = callbacks[i];\n callback && callback(...args);\n }\n };\n}\nexport const clamp = (n, min, max) => Math.min(Math.max(n, min), max);\n/**\n * Accesses the value of a MaybeAccessor\n * @example\n * ```ts\n * access(\"foo\") // => \"foo\"\n * access(() => \"foo\") // => \"foo\"\n * ```\n */\nexport const access = (v) => typeof v === \"function\" && !v.length ? v() : v;\nexport const asArray = (value) => Array.isArray(value) ? value : value ? [value] : [];\n/**\n * Access an array of MaybeAccessors\n * @example\n * const list = [1, 2, () => 3)] // T: MaybeAccessor<number>[]\n * const newList = accessArray(list) // T: number[]\n */\nexport const accessArray = (list) => list.map(v => access(v));\n/**\n * Run the function if the accessed value is not `undefined` nor `null`\n * @param value\n * @param fn\n */\nexport const withAccess = (value, fn) => {\n const _value = access(value);\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n typeof _value != null && fn(_value);\n};\nexport const asAccessor = (v) => (typeof v === \"function\" ? v : () => v);\n/** If value is a function \u2013 call it with a given arguments \u2013 otherwise get the value as is */\nexport function accessWith(valueOrFn, ...args) {\n return typeof valueOrFn === \"function\" ? valueOrFn(...args) : valueOrFn;\n}\nexport function defer(deps, fn, initialValue) {\n const isArray = Array.isArray(deps);\n let prevInput;\n let shouldDefer = true;\n return prevValue => {\n let input;\n if (isArray) {\n input = Array(deps.length);\n for (let i = 0; i < deps.length; i++)\n input[i] = deps[i]();\n }\n else\n input = deps();\n if (shouldDefer) {\n shouldDefer = false;\n prevInput = input;\n return initialValue;\n }\n const result = untrack(() => fn(input, prevInput, prevValue));\n prevInput = input;\n return result;\n };\n}\n/**\n * Get entries of an object\n */\nexport const entries = Object.entries;\n/**\n * Get keys of an object\n */\nexport const keys = Object.keys;\n/**\n * Solid's `onCleanup` that doesn't warn in development if used outside of a component.\n */\nexport const tryOnCleanup = isDev\n ? fn => (getOwner() ? onCleanup(fn) : fn)\n : onCleanup;\nexport const createCallbackStack = () => {\n let stack = [];\n const clear = () => (stack = []);\n return {\n push: (...callbacks) => stack.push(...callbacks),\n execute(arg0, arg1, arg2, arg3) {\n stack.forEach(cb => cb(arg0, arg1, arg2, arg3));\n clear();\n },\n clear,\n };\n};\n/**\n * Group synchronous function calls.\n * @param fn\n * @returns `fn`\n */\nexport function createMicrotask(fn) {\n let calls = 0;\n let args;\n onCleanup(() => (calls = 0));\n return (...a) => {\n (args = a), calls++;\n queueMicrotask(() => --calls === 0 && fn(...args));\n };\n}\n/**\n * A hydratable version of the {@link createSignal}. It will use the serverValue on the server and the update function on the client. If initialized during hydration it will use serverValue as the initial value and update it once hydration is complete.\n *\n * @param serverValue initial value of the state on the server\n * @param update called once on the client or on hydration to initialize the value\n * @param options {@link SignalOptions}\n * @returns\n * ```ts\n * [state: Accessor<T>, setState: Setter<T>]\n * ```\n * @see {@link createSignal}\n */\nexport function createHydratableSignal(serverValue, update, options) {\n if (isServer) {\n return createSignal(serverValue, options);\n }\n if (sharedConfig.context) {\n const [state, setState] = createSignal(serverValue, options);\n onMount(() => setState(() => update()));\n return [state, setState];\n }\n return createSignal(update(), options);\n}\n/** @deprecated use {@link createHydratableSignal} instead */\nexport const createHydrateSignal = createHydratableSignal;\n/**\n * Handle items removed and added to the array by diffing it by refference.\n *\n * @param current new array instance\n * @param prev previous array copy\n * @param handleAdded called once for every added item to array\n * @param handleRemoved called once for every removed from array\n */\nexport function handleDiffArray(current, prev, handleAdded, handleRemoved) {\n const currLength = current.length;\n const prevLength = prev.length;\n let i = 0;\n if (!prevLength) {\n for (; i < currLength; i++)\n handleAdded(current[i]);\n return;\n }\n if (!currLength) {\n for (; i < prevLength; i++)\n handleRemoved(prev[i]);\n return;\n }\n for (; i < prevLength; i++) {\n if (prev[i] !== current[i])\n break;\n }\n let prevEl;\n let currEl;\n prev = prev.slice(i);\n current = current.slice(i);\n for (prevEl of prev) {\n if (!current.includes(prevEl))\n handleRemoved(prevEl);\n }\n for (currEl of current) {\n if (!prev.includes(currEl))\n handleAdded(currEl);\n }\n}\n// \u2500\u2500\u2500 String transforms \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n/**\n * Parse a string as a single JSON value.\n *\n * ```ts\n * const { data } = createSSE<{ status: string }>(url, { transform: json });\n * ```\n */\nexport const json = (raw) => JSON.parse(raw);\n/**\n * Parse a string as newline-delimited JSON (NDJSON / JSON Lines).\n *\n * Each non-empty line is parsed as a separate JSON value and returned as an array.\n *\n * ```ts\n * const { data } = createSSE<TickEvent[]>(url, { transform: ndjson });\n * // data() === [{ id: 1, type: \"tick\" }, { id: 2, type: \"tick\" }]\n * ```\n */\nexport const ndjson = (raw) => raw\n .split(\"\\n\")\n .filter(line => line !== \"\")\n .map(line => JSON.parse(line));\n/**\n * Split a string into individual lines, returning a `string[]`. Empty lines are filtered out.\n *\n * ```ts\n * const { data } = createSSE<string[]>(url, { transform: lines });\n * // data() === [\"line one\", \"line two\"]\n * ```\n */\nexport const lines = (raw) => raw.split(\"\\n\").filter(line => line !== \"\");\n/**\n * Parse a string as a number using `Number()` semantics.\n *\n * Note: `\"\"` \u2192 `0`, non-numeric strings \u2192 `NaN`.\n *\n * ```ts\n * const { data } = createSSE<number>(url, { transform: number });\n * // data() === 42\n * ```\n */\nexport const number = (raw) => Number(raw);\nexport function safe(transform, fallback) {\n return (raw) => {\n try {\n return transform(raw);\n }\n catch {\n return fallback;\n }\n };\n}\n/**\n * Compose two transforms into one: the output of `a` is passed as the input of `b`.\n *\n * ```ts\n * const { data } = createSSE<RawEvent[]>(url, {\n * transform: pipe(ndjson<RawEvent>, rows => rows.filter(r => r.type === \"tick\")),\n * });\n * ```\n */\nexport function pipe(a, b) {\n return (raw) => b(a(raw));\n}\n", "import type {AutomergeUrl, DocHandle} from \"@automerge/automerge-repo/slim\"\nimport {createEffect, createResource, useContext, type Resource} from \"solid-js\"\nimport {access, type MaybeAccessor} from \"@solid-primitives/utils\"\nimport {RepoContext} from \"./context.ts\"\nimport type {UseDocHandleOptions} from \"./types.ts\"\n\n/**\n * get a\n * [DocHandle](https://automerge.org/automerge-repo/classes/_automerge_automerge_repo.DocHandle.html)\n * from an\n * [AutomergeUrl](https://automerge.org/automerge-repo/types/_automerge_automerge_repo.AutomergeUrl.html)\n * as a\n * [Resource](https://docs.solidjs.com/reference/basic-reactivity/create-resource).\n * Waits for the handle to be ready.\n */\nexport default function useDocHandle<T>(\n\turl: MaybeAccessor<AutomergeUrl | undefined>,\n\toptions?: UseDocHandleOptions\n): Resource<DocHandle<T> | undefined> {\n\tconst contextRepo = useContext(RepoContext)\n\n\tif (!options?.repo && !contextRepo) {\n\t\tthrow new Error(\"use outside <RepoContext> requires options.repo\")\n\t}\n\n\tconst repo = (options?.repo || contextRepo)!\n\n\tfunction getExistingHandle() {\n\t\tif (options?.[\"~skipInitialValue\"]) return undefined\n\t\tconst unwrappedURL = access(url)\n\t\tif (!unwrappedURL) return undefined\n\t\tconst state = repo.findWithProgress<T>(unwrappedURL).peek()\n\t\treturn state.state === \"ready\" ? state.handle : undefined\n\t}\n\n\tconst [handle, {mutate}] = createResource(\n\t\turl,\n\t\turl => repo.findWithProgress<T>(url).whenReady(),\n\t\t{\n\t\t\tinitialValue: getExistingHandle(),\n\t\t}\n\t)\n\n\tcreateEffect(() => {\n\t\tif (!access(url)) {\n\t\t\tmutate()\n\t\t}\n\t})\n\n\treturn handle\n}\n", "import type {Repo} from \"@automerge/automerge-repo/slim\"\nimport {createContext, type Context} from \"solid-js\"\n\n/**\n * a [context](https://docs.solidjs.com/concepts/context) that provides access\n * to an Automerge Repo. you don't need this, you can pass the repo in the\n * second arg to the functions that need it.\n */\nexport const RepoContext: Context<Repo | null> = createContext<Repo | null>(\n\tnull\n)\n", "import type {AutomergeUrl, Doc, DocHandle} from \"@automerge/automerge-repo/slim\"\nimport createDocumentProjection from \"./createDocumentProjection.ts\"\nimport type {MaybeAccessor} from \"@solid-primitives/utils\"\nimport useDocHandle from \"./useDocHandle.ts\"\nimport type {UseDocHandleOptions} from \"./types.ts\"\nimport type {Accessor, Resource} from \"solid-js\"\n\n/**\n * get a fine-grained live view of a document, and its handle, from a URL.\n * @param url a function that returns a url\n */\nexport default function useDocument<T extends object>(\n\turl: MaybeAccessor<AutomergeUrl | undefined>,\n\toptions?: UseDocHandleOptions\n): [Accessor<Doc<T> | undefined>, Resource<DocHandle<T> | undefined>] {\n\tconst handle = useDocHandle<T>(url, options)\n\treturn [createDocumentProjection<T>(handle), handle] as const\n}\n", "import {onCleanup, type Accessor} from \"solid-js\"\nimport {createSignal} from \"solid-js\"\nimport type {Doc, DocHandle} from \"@automerge/automerge-repo/slim\"\n\n/**\n * a light coarse-grained primitive when you care only _that_ a doc has changed,\n * and not _how_.\n * @param handle an Automerge\n * [DocHandle](https://automerge.org/automerge-repo/classes/_automerge_automerge_repo.DocHandle.html)\n */\nexport default function makeDocSignal<T extends object>(\n\thandle: DocHandle<T>\n): Accessor<Doc<T> | undefined> {\n\tconst [signal, setSignal] = createSignal<Doc<T> | undefined>(handle.doc())\n\n\tfunction update() {\n\t\tsetSignal(() => handle.doc() as Doc<T> | undefined)\n\t}\n\n\thandle.on(\"change\", update)\n\tonCleanup(() => handle.off(\"change\", update))\n\n\treturn signal\n}\n", "import {createEffect, onCleanup, type Accessor} from \"solid-js\"\nimport {createSignal} from \"solid-js\"\nimport type {Doc, DocHandle} from \"@automerge/automerge-repo/slim\"\n\n/**\n * a light coarse-grained primitive when you care only _that_ a doc has changed,\n * and not _how_. works with {@link useDocHandle}.\n * @param handle an accessor (signal/resource) of a\n * [DocHandle](https://automerge.org/automerge-repo/classes/_automerge_automerge_repo.DocHandle.html)\n */\nexport default function createDocSignal<T extends object>(\n\thandle: Accessor<DocHandle<T> | undefined>\n): Accessor<Doc<T> | undefined> {\n\tconst [signal, setSignal] = createSignal<Doc<T> | undefined>(handle()?.doc())\n\n\tcreateEffect(() => {\n\t\tconst h = handle()\n\n\t\tfunction update() {\n\t\t\tsetSignal(() => h?.doc() as Doc<T> | undefined)\n\t\t}\n\n\t\t// sync the signal with the current handle's doc\n\t\tupdate()\n\n\t\tif (h) {\n\t\t\th.on(\"change\", update)\n\t\t\tonCleanup(() => h.off(\"change\", update))\n\t\t}\n\t})\n\n\treturn signal\n}\n", "import type {Repo} from \"@automerge/automerge-repo/slim\"\nimport {RepoContext} from \"./context.ts\"\nimport {useContext} from \"solid-js\"\n\n/** grab the repo from the {@link RepoContext} */\nexport default function useRepo(): Repo {\n\tconst repo = useContext(RepoContext)\n\tif (!repo) throw new Error(\"Please wrap me in a <RepoContext value={repo}>\")\n\treturn repo\n}\n", "import { template as _$template } from \"solid-js/web\";\nimport { delegateEvents as _$delegateEvents } from \"solid-js/web\";\nimport { getOwner as _$getOwner } from \"solid-js/web\";\nimport { insert as _$insert } from \"solid-js/web\";\nimport { createComponent as _$createComponent } from \"solid-js/web\";\nvar _tmpl$ = /*#__PURE__*/_$template(`<div class=context-sidebar__tabs><button type=button class=context-sidebar__close title=\"Hide context sidebar\"aria-label=\"Hide context sidebar\">`),\n _tmpl$2 = /*#__PURE__*/_$template(`<div class=context-sidebar__content>`),\n _tmpl$3 = /*#__PURE__*/_$template(`<div class=context-sidebar>`),\n _tmpl$4 = /*#__PURE__*/_$template(`<patchwork-view>`, true, false, false),\n _tmpl$5 = /*#__PURE__*/_$template(`<svg xmlns=http://www.w3.org/2000/svg width=18 height=18 viewBox=\"0 0 24 24\"fill=none stroke=var(--studio-chrome-line) stroke-width=1.75 stroke-linecap=round stroke-linejoin=round><rect width=18 height=18 x=3 y=3 rx=2></rect><path d=\"M15 3v18\">`);\nimport { Show } from \"solid-js\";\nimport { useTaggedComponents } from \"../hooks\";\nimport { Sidebar } from \"./Sidebar\";\nimport { ContextTabs } from \"./ContextTabs\";\nexport function ContextSidebar(props) {\n const items = useTaggedComponents(\"context-tool\");\n const activeToolId = () => {\n const ids = items().map(item => item.id);\n const selected = props.selectedToolId();\n return selected && ids.includes(selected) ? selected : ids[0];\n };\n return _$createComponent(Sidebar, {\n side: \"right\",\n get isCollapsed() {\n return props.isCollapsed;\n },\n get width() {\n return props.width;\n },\n get onMouseDown() {\n return props.onMouseDown;\n },\n get onToggleClick() {\n return props.onToggleClick;\n },\n get canExpand() {\n return props.canExpand;\n },\n get children() {\n var _el$ = _tmpl$3();\n _$insert(_el$, _$createComponent(Show, {\n get when() {\n return items().length;\n },\n get children() {\n var _el$2 = _tmpl$(),\n _el$3 = _el$2.firstChild;\n _$insert(_el$2, _$createComponent(ContextTabs, {\n items: items,\n get selectedToolId() {\n return props.selectedToolId;\n },\n get setSelectedToolId() {\n return props.setSelectedToolId;\n }\n }), _el$3);\n _el$3.$$click = () => props.onCollapse();\n _$insert(_el$3, _$createComponent(PanelRightIcon, {}));\n return _el$2;\n }\n }), null);\n _$insert(_el$, _$createComponent(Show, {\n get when() {\n return !props.isCollapsed();\n },\n get children() {\n var _el$4 = _tmpl$2();\n _$insert(_el$4, _$createComponent(Show, {\n get when() {\n return activeToolId();\n },\n keyed: true,\n children: id => (() => {\n var _el$5 = _tmpl$4();\n _el$5.component = id;\n _el$5._$owner = _$getOwner();\n return _el$5;\n })()\n }));\n return _el$4;\n }\n }), null);\n return _el$;\n }\n });\n}\nexport function PanelRightIcon() {\n return _tmpl$5();\n}\n_$delegateEvents([\"click\"]);", "import { template as _$template } from \"solid-js/web\";\nimport { delegateEvents as _$delegateEvents } from \"solid-js/web\";\nimport { setStyleProperty as _$setStyleProperty } from \"solid-js/web\";\nimport { setAttribute as _$setAttribute } from \"solid-js/web\";\nimport { insert as _$insert } from \"solid-js/web\";\nimport { memo as _$memo } from \"solid-js/web\";\nimport { effect as _$effect } from \"solid-js/web\";\nimport { getOwner as _$getOwner } from \"solid-js/web\";\nvar _tmpl$ = /*#__PURE__*/_$template(`<patchwork-view>`, true, false, false),\n _tmpl$2 = /*#__PURE__*/_$template(`<div class=sidebar>`),\n _tmpl$3 = /*#__PURE__*/_$template(`<button class=\"sidebar-toggle sidebar-toggle--resizable\"aria-label=\"Toggle or resize sidebar\"title=\"Click to toggle, drag to resize\">`),\n _tmpl$4 = /*#__PURE__*/_$template(`<button class=\"sidebar-toggle sidebar-toggle--resizable\"aria-label=\"Expand sidebar\"title=\"Click to expand, drag to resize\">`);\nexport function Sidebar(props) {\n const widthStyle = () => `${props.isCollapsed() ? 0 : props.width()}px`;\n const content = () => {\n if (props.children !== void 0) return props.children;\n if (props.toolId && props.docUrl) {\n return (() => {\n var _el$ = _tmpl$();\n _el$._$owner = _$getOwner();\n _$effect(_p$ => {\n var _v$ = props.docUrl,\n _v$2 = props.toolId;\n _v$ !== _p$.e && (_el$.docUrl = _p$.e = _v$);\n _v$2 !== _p$.t && (_el$.toolId = _p$.t = _v$2);\n return _p$;\n }, {\n e: undefined,\n t: undefined\n });\n return _el$;\n })();\n }\n return null;\n };\n const canExpand = () => props.canExpand?.() ?? true;\n return (() => {\n var _el$2 = _tmpl$2();\n _$insert(_el$2, (() => {\n var _c$ = _$memo(() => !!(props.side === \"left\" && !props.isCollapsed()));\n return () => _c$() && content();\n })(), null);\n _$insert(_el$2, (() => {\n var _c$2 = _$memo(() => !!(props.side === \"left\" && !props.isCollapsed()));\n return () => _c$2() && (() => {\n var _el$3 = _tmpl$3();\n _el$3.$$mousedown = e => props.onMouseDown(props.side, e);\n _el$3.$$click = e => props.onToggleClick(props.side, e);\n return _el$3;\n })();\n })(), null);\n _$insert(_el$2, (() => {\n var _c$3 = _$memo(() => !!(props.side === \"left\" && props.isCollapsed() && canExpand()));\n return () => _c$3() && (() => {\n var _el$4 = _tmpl$4();\n _el$4.$$mousedown = e => props.onMouseDown(props.side, e);\n _el$4.$$click = e => props.onToggleClick(props.side, e);\n return _el$4;\n })();\n })(), null);\n _$insert(_el$2, (() => {\n var _c$4 = _$memo(() => !!(props.side === \"right\" && !props.isCollapsed()));\n return () => _c$4() && (() => {\n var _el$5 = _tmpl$3();\n _el$5.$$mousedown = e => props.onMouseDown(props.side, e);\n _el$5.$$click = e => props.onToggleClick(props.side, e);\n return _el$5;\n })();\n })(), null);\n _$insert(_el$2, (() => {\n var _c$5 = _$memo(() => !!(props.side === \"right\" && props.isCollapsed() && canExpand()));\n return () => _c$5() && (() => {\n var _el$6 = _tmpl$4();\n _el$6.$$mousedown = e => props.onMouseDown(props.side, e);\n _el$6.$$click = e => props.onToggleClick(props.side, e);\n return _el$6;\n })();\n })(), null);\n _$insert(_el$2, (() => {\n var _c$6 = _$memo(() => !!(props.side === \"right\" && !props.isCollapsed()));\n return () => _c$6() && content();\n })(), null);\n _$effect(_p$ => {\n var _v$3 = props.side,\n _v$4 = props.isCollapsed() ? \"\" : void 0,\n _v$5 = widthStyle();\n _v$3 !== _p$.e && _$setAttribute(_el$2, \"data-side\", _p$.e = _v$3);\n _v$4 !== _p$.t && _$setAttribute(_el$2, \"data-collapsed\", _p$.t = _v$4);\n _v$5 !== _p$.a && _$setStyleProperty(_el$2, \"width\", _p$.a = _v$5);\n return _p$;\n }, {\n e: undefined,\n t: undefined,\n a: undefined\n });\n return _el$2;\n })();\n}\n_$delegateEvents([\"click\", \"mousedown\"]);", "import { template as _$template } from \"solid-js/web\";\nimport { delegateEvents as _$delegateEvents } from \"solid-js/web\";\nimport { setAttribute as _$setAttribute } from \"solid-js/web\";\nimport { effect as _$effect } from \"solid-js/web\";\nimport { insert as _$insert } from \"solid-js/web\";\nimport { createComponent as _$createComponent } from \"solid-js/web\";\nvar _tmpl$ = /*#__PURE__*/_$template(`<div role=tablist class=context-sidebar__tablist>`),\n _tmpl$2 = /*#__PURE__*/_$template(`<button type=button role=tab class=context-sidebar__tab>`);\nimport { For } from \"solid-js\";\nexport function ContextTabs(props) {\n const activeToolId = () => {\n const ids = props.items().map(item => item.id);\n const selected = props.selectedToolId();\n return selected && ids.includes(selected) ? selected : ids[0];\n };\n return (() => {\n var _el$ = _tmpl$();\n _$insert(_el$, _$createComponent(For, {\n get each() {\n return props.items();\n },\n children: item => (() => {\n var _el$2 = _tmpl$2();\n _el$2.$$click = () => props.setSelectedToolId(item.id);\n _$insert(_el$2, () => item.name);\n _$effect(() => _$setAttribute(_el$2, \"data-active\", activeToolId() === item.id ? \"\" : void 0));\n return _el$2;\n })()\n }));\n return _el$;\n })();\n}\n_$delegateEvents([\"click\"]);", "import { template as _$template } from \"solid-js/web\";\nimport { effect as _$effect } from \"solid-js/web\";\nimport { getOwner as _$getOwner } from \"solid-js/web\";\nimport { createComponent as _$createComponent } from \"solid-js/web\";\nimport { memo as _$memo } from \"solid-js/web\";\nvar _tmpl$ = /*#__PURE__*/_$template(`<patchwork-view>`, true, false, false);\nimport { Show } from \"solid-js\";\nexport const slotId = slot => Array.isArray(slot) ? String(slot[0]) : String(slot);\nexport function uniqueSlots(slots) {\n const seen = /* @__PURE__ */new Set();\n return slots.filter(slot => {\n const id = slotId(slot);\n if (seen.has(id)) return false;\n seen.add(id);\n return true;\n });\n}\nexport function SlotView(props) {\n return _$createComponent(Show, {\n get when() {\n return _$memo(() => !!Array.isArray(props.slot))() ? props.slot : false;\n },\n get fallback() {\n return (() => {\n var _el$ = _tmpl$();\n _el$._$owner = _$getOwner();\n _$effect(() => _el$.component = String(props.slot));\n return _el$;\n })();\n },\n children: tuple => (() => {\n var _el$2 = _tmpl$();\n _el$2._$owner = _$getOwner();\n _$effect(_p$ => {\n var _v$ = tuple()[1],\n _v$2 = tuple()[0];\n _v$ !== _p$.e && (_el$2.docUrl = _p$.e = _v$);\n _v$2 !== _p$.t && (_el$2.toolId = _p$.t = _v$2);\n return _p$;\n }, {\n e: undefined,\n t: undefined\n });\n return _el$2;\n })()\n });\n}", "import { template as _$template } from \"solid-js/web\";\nimport { effect as _$effect } from \"solid-js/web\";\nimport { getOwner as _$getOwner } from \"solid-js/web\";\nimport { insert as _$insert } from \"solid-js/web\";\nimport { memo as _$memo } from \"solid-js/web\";\nimport { createComponent as _$createComponent } from \"solid-js/web\";\nimport { use as _$use } from \"solid-js/web\";\nvar _tmpl$ = /*#__PURE__*/_$template(`<div class=document-view>`),\n _tmpl$2 = /*#__PURE__*/_$template(`<patchwork-view>`, true, false, false),\n _tmpl$3 = /*#__PURE__*/_$template(`<div class=placeholder>Select a document in the sidebar`);\nimport { Show } from \"solid-js\";\nexport function MainDocumentView({\n viewKey,\n selectedDocUrl,\n toolId,\n ref\n}) {\n return (() => {\n var _el$ = _tmpl$();\n var _ref$ = ref;\n typeof _ref$ === \"function\" ? _$use(_ref$, _el$) : ref = _el$;\n _$insert(_el$, _$createComponent(Show, {\n get when() {\n return viewKey();\n },\n keyed: true,\n children: key => {\n return (() => {\n var _el$2 = _tmpl$2();\n _el$2._$owner = _$getOwner();\n _$effect(_p$ => {\n var _v$ = selectedDocUrl(),\n _v$2 = toolId();\n _v$ !== _p$.e && (_el$2.docUrl = _p$.e = _v$);\n _v$2 !== _p$.t && (_el$2.toolId = _p$.t = _v$2);\n return _p$;\n }, {\n e: undefined,\n t: undefined\n });\n return _el$2;\n })();\n }\n }), null);\n _$insert(_el$, (() => {\n var _c$ = _$memo(() => !!!selectedDocUrl());\n return () => _c$() && _tmpl$3();\n })(), null);\n return _el$;\n })();\n}", ":root,\n:host,\n[theme] {\n --threepane-bg: var(--studio-fill, white);\n --threepane-sidebar-fill: var(--studio-chrome, var(--studio-fill, white));\n --threepane-fg: var(--studio-line, black);\n /* ink for text sitting ON the sidebar/account-bar chrome surface. mirrors the\n toolbar/context-sidebar fg: it rides --studio-chrome-line (the chrome's own\n ink) so it tracks the chrome palette, not the content page. --threepane-fg\n is content ink and only belongs on --threepane-bg surfaces. */\n --threepane-sidebar-fg: var(--studio-chrome-line, var(--studio-line, black));\n --threepane-muted: var(--studio-line-offset-50, #999);\n --threepane-family: var(--studio-family-sans, system-ui, sans-serif);\n --threepane-family-code: var(--studio-family-code, ui-monospace, monospace);\n\n /* spacing scale, aliased from the base theme */\n --threepane-space-3xs: var(--studio-space-3xs, 0.125rem);\n --threepane-space-2xs: var(--studio-space-2xs, 0.25rem);\n --threepane-space-xs: var(--studio-space-xs, 0.375rem);\n --threepane-space-sm: var(--studio-space-sm, 0.5rem);\n --threepane-space: var(--studio-space, 0.75rem);\n --threepane-space-md: var(--studio-space-md, 1rem);\n --threepane-space-2xl: var(--studio-space-2xl, 3rem);\n\n /* radius scale, aliased from the base theme */\n --threepane-radius-xs: var(--studio-radius-xs, 2px);\n --threepane-radius-sm: var(--studio-radius-sm, 4px);\n --threepane-radius-md: var(--studio-radius-md, 8px);\n --threepane-radius-round: var(--studio-radius-round, 9999px);\n\n /* Height of the frame's top strip: the top bar over the main column, and the\n matching empty space reserved above the left sidebar's widgets so the two\n line up and the left toggle has a home. */\n --threepane-header-height: calc(\n env(safe-area-inset-top, 0px) + var(--threepane-space-2xl)\n );\n\n /* the left footer and right tray boxes share one height so they line up. */\n --threepane-tray-height: var(--threepane-space-2xl);\n /* sidebar toggles ride a touch paler than the line (first ink offset). they\n sit on chrome (left toggle over the sidebar, right over the toolbar), so\n they use the chrome ink ramp, not the content one. */\n --threepane-toggle-fg: var(--studio-chrome-line-offset-10, var(--studio-line-offset-10, #333));\n\n --threepane-toolbar: var(--studio-chrome, white);\n /* toolbar text rides on the chrome surface, so it uses the chrome ink */\n --threepane-toolbar-fg: var(--studio-chrome-line, var(--studio-line, black));\n --threepane-toolbar-border: var(--studio-chrome-offset-10, #ddd);\n /* Resize handle: a faint 1px divider that tracks the chrome ramp's contrast\n (it mixes toward the chrome ink, so it reads darker on light themes and\n lighter on dark ones), plus a primary-tinted glow + grab pill on hover. */\n --threepane-sidebar-divider: var(--studio-chrome-offset-20, #d4d4d4);\n --threepane-resize-glow: color-mix(in oklch, var(--studio-primary-fill, var(--studio-primary, #35f7ca)), transparent 35%);\n --threepane-resize-pill: var(--studio-primary-fill, var(--studio-primary, #35f7ca));\n\n /* The context (right) sidebar sits on a chrome surface stepped one offset off\n the toolbar's flat chrome, so the two chrome regions read as distinct. */\n --threepane-context-sidebar-fill: var(--studio-chrome-offset-10, #ececec);\n\n /* Context sidebar (tabbed) */\n --context-sidebar-bg: var(--threepane-context-sidebar-fill);\n /* the tab-bar header rides on the same flat chrome as the toolbar above it,\n so the two chrome strips read as one continuous band */\n --context-sidebar-header-bg: var(--studio-chrome, #f2f2f2);\n --context-sidebar-fg: var(--studio-chrome-line, var(--studio-line, black));\n /* match the lines drawn around the document-view so tab/tray edges read as\n one continuous frame */\n --context-sidebar-border: var(--threepane-toolbar-border);\n --context-sidebar-tab-fg: var(--studio-chrome-line-offset-40, var(--studio-line-offset-40, #666));\n --context-sidebar-tab-hover: var(--studio-chrome-offset-10, #e5e5e5);\n --context-sidebar-tab-active-bg: var(--studio-fill, white);\n --context-sidebar-tab-active-fg: var(--studio-line, black);\n --context-sidebar-tab-active-accent: var(--studio-primary-line, var(--studio-primary, #35f7ca));\n /* the content panel shares the active tab's surface so the selected tab\n connects seamlessly into the tool view below it */\n --context-sidebar-content-bg: var(--context-sidebar-tab-active-bg);\n --context-sidebar-family: var(--studio-family-sans, system-ui, sans-serif);\n}\n\n.frame-shell {\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n}\n\n.frame-warning-banner {\n flex: none;\n padding: var(--threepane-space-2xs) var(--threepane-space-sm);\n text-align: center;\n text-transform: uppercase;\n font-family: var(--studio-family-ui, var(--threepane-family));\n font-size: 0.75rem;\n background: var(--studio-warning-fill, yellow);\n color: var(--studio-warning-line);\n}\n\n.frame {\n position: relative;\n display: flex;\n width: 100%;\n flex: 1;\n min-height: 0;\n font-family: var(--threepane-family);\n color: var(--threepane-fg);\n background: var(--threepane-bg);\n}\n\n.frame__version {\n position: absolute;\n top: var(--threepane-space-2xs);\n right: var(--threepane-space-sm);\n z-index: 10;\n color: var(--threepane-muted);\n font-size: 0.75rem;\n font-weight: 500;\n pointer-events: none;\n user-select: none;\n}\n\n.sidebar {\n position: relative;\n display: flex;\n flex: none;\n /* visible so the resize handle can straddle the boundary (sit on *both*\n sides of the divider line); the content clips itself instead. z-index lifts\n the handle's outer half above the main area so it stays grabbable. */\n overflow: visible;\n z-index: 1;\n}\n\n.sidebar[data-collapsed] {\n overflow: visible;\n}\n\n.sidebar[data-side=\"left\"] {\n background: var(--threepane-sidebar-fill);\n color: var(--threepane-sidebar-fg);\n}\n\n.sidebar[data-side=\"right\"] {\n background: var(--threepane-context-sidebar-fill);\n}\n\n.main-area {\n flex: 1;\n min-width: 0;\n display: flex;\n flex-direction: column;\n height: 100%;\n overflow: hidden;\n}\n\n/* The main column (right of the left sidebar): a row of\n [document column | right sidebar], so the right sidebar spans the full frame\n height and its resize divider runs top-to-bottom exactly like the left one. */\n.frame__main-column {\n position: relative;\n flex: 1;\n min-width: 0;\n display: flex;\n flex-direction: row;\n height: 100%;\n overflow: hidden;\n}\n\n/* The document column: the top bar over the main document view. Sits left of the\n full-height context sidebar. */\n.frame__doc-column {\n flex: 1;\n min-width: 0;\n width: 100%;\n display: flex;\n flex-direction: column;\n height: 100%;\n overflow: hidden;\n}\n\n.frame__doc-column > patchwork-view,\n.frame__doc-column > patchwork-view > patchwork-view,\n.frame__doc-column > patchwork-view > patchwork-view > patchwork-view,\n.frame__doc-column\n > patchwork-view\n > patchwork-view\n > patchwork-view\n > patchwork-view {\n display: contents;\n}\n\n/* The full-width top toolbar. Its height + top safe-area inset match the\n sideboard's reserved top margin so the bar reads as continuous across the top\n (the left sidebar's empty top region lines up with it). */\n.frame__topbar {\n display: flex;\n align-items: stretch;\n box-sizing: border-box;\n min-height: var(--threepane-space-2xl);\n padding-top: env(safe-area-inset-top, 0px);\n padding-inline: var(--threepane-space-2xs);\n gap: var(--threepane-space-2xs);\n background: var(--threepane-toolbar);\n color: var(--threepane-toolbar-fg);\n /* A hairline along the bottom, in the same colour as the document-view's\n border, so the line under the bar runs unbroken across the whole width\n (document column + context tabs). The active tab pulls down 1px to break\n through it and connect to its panel below. */\n border-bottom: 1px solid var(--threepane-toolbar-border);\n /* Animate the collapsed left-slot in step with the sidebar's width transition\n so the title glides up against the pinned toggle instead of jumping. */\n transition: padding-left var(--studio-transition-slow, 0.25s ease);\n}\n\n/* When the left sidebar is collapsed the bar's left edge reaches the frame edge,\n where the pinned left toggle lives; reserve a matching slot so the title slides\n up against the toggle rather than under it. */\n.frame__topbar--left-collapsed {\n padding-left: var(--threepane-space-2xl);\n}\n\n/* The left sidebar toggle, pinned to the frame's top-left corner so it keeps the\n same spot whether the sidebar is open or closed. Square, filling the top strip;\n sits over the sidebar's reserved (empty) top area when open. */\n.frame__left-toggle {\n position: absolute;\n top: 0;\n left: 0;\n z-index: 5;\n width: var(--threepane-space-2xl);\n height: var(--threepane-header-height);\n padding-top: env(safe-area-inset-top, 0px);\n}\n\n/* A sidebar toggle at either end of the top bar (always present). */\n.frame__sidebar-toggle {\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n padding-inline: var(--threepane-space-sm);\n border: none;\n background: transparent;\n color: var(--threepane-toggle-fg);\n cursor: pointer;\n transition: color var(--studio-transition-fast, 0.1s ease);\n}\n\n.frame__sidebar-toggle:hover {\n color: var(--threepane-sidebar-fg);\n}\n\n/* The document title, rendered intrinsically: shrinks to the title's width but\n never past half the bar; ellipsis beyond. */\n.threepane__title {\n display: flex;\n align-items: center;\n flex: 0 1 auto;\n min-width: 0;\n max-width: 50%;\n overflow: hidden;\n padding-inline: var(--threepane-space-sm);\n}\n\n.threepane__title-text {\n font-weight: 600;\n white-space: nowrap;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.threepane__title-text--editable {\n cursor: text;\n}\n\n.threepane__title-text--editable:hover {\n opacity: 0.7;\n}\n\n.threepane__title-input {\n font: inherit;\n font-weight: 600;\n color: inherit;\n min-width: 0;\n width: 100%;\n padding: 0;\n margin: 0;\n border: none;\n outline: none;\n background: transparent;\n}\n\n/* built-in spacer between the title and the right-hand tools */\n.threepane__spacer {\n flex: 1;\n min-width: var(--threepane-space-sm);\n}\n\n/* configured doctitle tools at the right end; scroll horizontally when they\n overflow rather than squashing. */\n.threepane__doctitle-tools {\n display: flex;\n align-items: center;\n gap: var(--threepane-space-sm);\n min-width: 0;\n padding-inline: var(--threepane-space-sm);\n overflow-x: auto;\n overflow-y: hidden;\n scrollbar-width: none;\n}\n\n.threepane__doctitle-tools::-webkit-scrollbar {\n display: none;\n}\n\n.threepane__doctitle-tools patchwork-view {\n display: flex;\n align-items: center;\n height: 2rem;\n flex-shrink: 0;\n width: auto;\n}\n\n.document-view {\n flex: 1;\n min-height: 0;\n overflow: hidden;\n /* Left divider only, square corners. The top line is the top bar's\n border-bottom and the bottom is open to the frame edge. The right divider\n (to the context sidebar) is the sidebar's own full-height border-left, so\n it runs the whole frame height rather than just the document view. When the\n left sidebar is collapsed the left divider is dropped (see the :has rule\n below) so nothing rides the frame edge. */\n border-left: 1px solid var(--threepane-toolbar-border);\n}\n\n/* Left sidebar collapsed to 0: drop the document-view's left divider so there's\n no stray line hugging the frame's left edge. */\n.frame:has(.sidebar[data-side=\"left\"][data-collapsed]) .document-view {\n border-left: none;\n}\n\n.document-view patchwork-view {\n display: block;\n width: 100%;\n height: 100%;\n}\n\n.placeholder {\n display: flex;\n align-items: center;\n justify-content: center;\n height: 100%;\n color: var(--threepane-fg);\n}\n\n.sidebar patchwork-view {\n display: block;\n width: 100%;\n height: 100%;\n /* the sidebar itself doesn't clip, so the content does */\n overflow: hidden;\n}\n\n/* Context sidebar (tabbed): lifted tabs with a top accent bar and surface fill\n on the active tab, a hover surface, and a bottom-border separator between the\n tab bar and the mounted tool view. */\n.context-sidebar {\n flex: 1;\n min-width: 0;\n width: 100%;\n height: 100%;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n font-family: var(--context-sidebar-family);\n color: var(--context-sidebar-fg);\n background: var(--context-sidebar-bg);\n /* The full-height divider between the document column and the sidebar. Lives\n here (not on the document view) so it runs the whole frame height \u2014 top bar\n level included \u2014 and the resize handle straddling this edge is grabbable end\n to end, matching the left sidebar. */\n border-left: 1px solid var(--context-sidebar-border);\n}\n\n/* Tab bar: the row holding the tab list and the collapse button. Its height +\n top safe-area inset match the document column's top bar so the two header\n strips line up and their bottom hairlines read as one continuous line across\n the divider. */\n.context-sidebar__tabs {\n display: flex;\n align-items: flex-end;\n box-sizing: border-box;\n min-height: var(--threepane-space-2xl);\n padding-top: env(safe-area-inset-top, 0px);\n background: var(--context-sidebar-header-bg);\n border-bottom: 1px solid var(--context-sidebar-border);\n}\n\n.context-sidebar__tablist {\n display: flex;\n flex: 1;\n min-width: 0;\n align-items: flex-end;\n gap: var(--threepane-space-2xs);\n padding-inline: var(--threepane-space-2xs);\n /* when there are more tabs than fit, scroll them horizontally rather than\n letting them shrink/wrap; scrollbar hidden for a clean header. */\n overflow-x: auto;\n overflow-y: hidden;\n scrollbar-width: none;\n /* extend the clip box 1px past the tab-bar border (compensated by the\n negative margin so layout is unchanged) so the active tab's -1px overflow\n isn't clipped by the horizontal scroll container, and it can still cover\n the border-bottom to connect into the panel. */\n padding-bottom: 1px;\n margin-bottom: -1px;\n}\n.context-sidebar__tablist::-webkit-scrollbar {\n display: none;\n}\n\n/* A single tab. */\n.context-sidebar__tab {\n display: flex;\n align-items: center;\n flex-shrink: 0;\n padding: var(--threepane-space-xs) var(--threepane-space-sm);\n border: 1px solid transparent;\n border-bottom: none;\n border-top-left-radius: var(--threepane-radius-xs);\n border-top-right-radius: var(--threepane-radius-xs);\n background: transparent;\n font-family: inherit;\n font-size: 0.875rem;\n white-space: nowrap;\n color: var(--context-sidebar-tab-fg);\n cursor: pointer;\n user-select: none;\n transition: background var(--studio-transition-fast, 0.1s ease),\n color var(--studio-transition-fast, 0.1s ease);\n}\n\n.context-sidebar__tab:hover {\n background: var(--context-sidebar-tab-hover);\n color: var(--context-sidebar-tab-active-fg);\n}\n\n/* Exception: the selected tab. Pulled down 1px so its fill covers the tab-bar's\n bottom border, connecting the tab seamlessly into the panel below. */\n.context-sidebar__tab[data-active] {\n position: relative;\n margin-bottom: -1px;\n background: var(--context-sidebar-tab-active-bg);\n color: var(--context-sidebar-tab-active-fg);\n border-color: var(--context-sidebar-border);\n box-shadow: inset 0 1px 0 0 var(--context-sidebar-tab-active-accent);\n}\n\n/* The close (collapse) button. Centred vertically in the tab header (the header\n is otherwise flex-end for the tabs) so it lands at the same height as the\n reopen toggle in the top bar when the sidebar is collapsed. */\n.context-sidebar__close {\n display: flex;\n align-items: center;\n justify-content: center;\n align-self: center;\n flex-shrink: 0;\n padding-inline: var(--threepane-space-sm);\n margin-right: var(--threepane-space-2xs);\n border: none;\n background: transparent;\n color: var(--context-sidebar-fg);\n cursor: pointer;\n opacity: 0.5;\n transition: opacity var(--studio-transition-fast, 0.1s ease);\n}\n\n.context-sidebar__close:hover {\n opacity: 1;\n}\n\n/* The mounted tool view. */\n.context-sidebar__content {\n flex: 1;\n min-height: 0;\n overflow: auto;\n background: var(--context-sidebar-content-bg);\n contain: content;\n}\n\n.context-sidebar__content patchwork-view {\n display: block;\n width: 100%;\n height: 100%;\n}\n\n/* Left sidebar body: a stack of widgets with the account footer pinned below. */\n.threepane-sidebar {\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n min-height: 0;\n}\n\n/* Reserve the docked tray's height at the sidebar's bottom so the account bar\n sits above the tray (which is pinned outside this collapsing column). */\n.threepane-sidebar--has-tray {\n padding-bottom: calc(\n var(--threepane-tray-height) + env(safe-area-inset-bottom, 0px)\n );\n}\n\n/* account / packages / settings footer, pinned to the sidebar bottom */\n.threepane-sidebar--has-tray .threepane-sidebar__footer {\n flex: none;\n margin-bottom: calc(var(--threepane-tray-height) + env(safe-area-inset-bottom, 0px));\n}\n\n/* The inlined account bar: avatar (account picker) + Packages + Settings. */\n.threepane-account-bar {\n container-type: inline-size;\n display: flex;\n align-items: center;\n gap: var(--threepane-space-md);\n min-height: var(--threepane-space-2xl);\n box-sizing: border-box;\n background: var(--threepane-sidebar-fill);\n color: var(--threepane-sidebar-fg);\n border-top: 1px solid var(--threepane-sidebar-divider);\n padding-block: var(--threepane-space-2xs);\n padding-bottom: calc(var(--threepane-space-2xs) + env(safe-area-inset-bottom));\n padding-left: calc(env(safe-area-inset-left) + var(--threepane-space-md));\n padding-right: calc(env(safe-area-inset-right) + var(--threepane-space-md));\n justify-content: space-between;\n overflow: hidden;\n}\n\n.threepane-account-bar__button {\n display: flex;\n align-items: center;\n border: 1px solid transparent;\n padding-inline: var(--threepane-space-2xs);\n padding-block: var(--threepane-space-3xs);\n border-radius: var(--threepane-radius-xs);\n background: transparent;\n color: inherit;\n font: inherit;\n white-space: nowrap;\n cursor: pointer;\n}\n\n.threepane-account-bar__button:hover {\n border-color: var(--threepane-sidebar-divider);\n}\n\n.threepane-account-bar__avatar {\n padding: 0;\n}\n\n.threepane-account-bar__avatar patchwork-view {\n display: block;\n width: 100%;\n height: 100%;\n}\n\n/* Left sidebar: a stack of configured widgets. The widgets start below the\n frame's top strip (the empty space matching the top bar), so the frame owns\n that spacing rather than each widget reserving its own top margin. */\n.threepane-widgets {\n flex: 1;\n display: flex;\n flex-direction: column;\n width: 100%;\n min-height: 0;\n padding-top: var(--threepane-header-height);\n gap: 1rem;\n}\n\n.threepane-widget {\n position: relative;\n flex: 1;\n min-height: 0;\n overflow: hidden;\n}\n\n.threepane-widget patchwork-view {\n display: block;\n width: 100%;\n height: 100%;\n}\n\n/* empty state: offer to add the document list */\n.threepane-widgets__empty {\n flex: 1;\n display: flex;\n align-items: flex-start;\n justify-content: center;\n}\n\n.threepane-widgets__add {\n padding: var(--threepane-space-xs) var(--threepane-space-sm);\n border: 1px dashed var(--threepane-sidebar-divider);\n border-radius: var(--threepane-radius-sm);\n background: transparent;\n color: var(--threepane-muted);\n font: inherit;\n cursor: pointer;\n white-space: nowrap;\n}\n\n.threepane-widgets__add:hover:not(:disabled) {\n color: var(--threepane-sidebar-fg);\n border-color: var(--threepane-sidebar-fg);\n}\n\n.threepane-widgets__add:disabled {\n opacity: 0.5;\n cursor: default;\n}\n\n/* System tray dock: pinned to the frame's bottom-left. Lives outside the\n collapsing left sidebar so it isn't torn down when the sidebar closes. When\n the sidebar is open the dock spans its width (set inline) and fills the space\n reserved by `threepane-sidebar--has-tray`; when the sidebar closes the dock is\n hidden (`display: none`) but stays mounted, so the tray is invisible while its\n tools keep running. */\n.frame__tray-dock {\n position: absolute;\n left: 0;\n bottom: 0;\n z-index: 4;\n box-sizing: border-box;\n /* Fade the tray in only *after* the sidebar's width animation completes, so it\n doesn't flash at full size over the still-expanding sidebar. The delay equals\n the sidebar's transition duration; collapsing overrides this to hide at once. */\n opacity: 1;\n transition: opacity 0.1s ease 0.25s;\n}\n\n.frame__tray-dock--collapsed {\n opacity: 0;\n pointer-events: none;\n /* Hide immediately on collapse \u2014 no wait, no fade. */\n transition: opacity 0s;\n}\n\n/* A row of tray-tagged tools, filling the dock. */\n.frame-tray {\n display: flex;\n align-items: center;\n gap: var(--threepane-space-2xs);\n box-sizing: border-box;\n /* min-height includes the safe-area inset (border-box), and the matching\n padding-bottom lifts the tray's contents clear of it while the tray's own\n background fills the inset down to the very bottom edge. */\n min-height: calc(\n var(--threepane-tray-height) + env(safe-area-inset-bottom, 0px)\n );\n padding-inline: var(--threepane-space-sm);\n padding-bottom: env(safe-area-inset-bottom, 0px);\n border-top: 1px solid var(--threepane-sidebar-divider);\n background: var(--threepane-sidebar-fill);\n}\n\n.frame-tray__item {\n display: flex;\n align-items: center;\n}\n\n.frame-tray patchwork-view {\n display: flex;\n width: auto;\n height: auto;\n}\n\n/* Debug Registry Toast */\n.debug-registry-toast {\n position: fixed;\n bottom: var(--threepane-space-md);\n right: var(--threepane-space-md);\n z-index: 9999;\n max-width: 360px;\n font-family: var(--threepane-family-code);\n font-size: 0.75rem;\n background: oklch(0.15 0.01 270);\n border: 1px solid oklch(0.35 0.03 270);\n border-radius: var(--threepane-radius-md);\n box-shadow:\n 0 8px 32px oklch(0 0 0 / 0.4),\n 0 0 0 1px oklch(1 0 0 / 0.05) inset;\n overflow: hidden;\n backdrop-filter: blur(12px);\n}\n\n.debug-registry-toast__header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: var(--threepane-space-sm) var(--threepane-space);\n background: oklch(0.2 0.02 270);\n border-bottom: 1px solid oklch(0.3 0.02 270);\n}\n\n.debug-registry-toast__title {\n color: oklch(0.85 0.1 270);\n font-weight: 600;\n letter-spacing: 0.02em;\n}\n\n.debug-registry-toast__clear {\n background: none;\n border: none;\n color: oklch(0.6 0.05 270);\n cursor: pointer;\n padding: var(--threepane-space-2xs) var(--threepane-space-sm);\n border-radius: var(--threepane-radius-sm);\n transition: all 0.15s ease;\n}\n\n.debug-registry-toast__clear:hover {\n background: oklch(0.25 0.02 270);\n color: oklch(0.9 0.05 0);\n}\n\n.debug-registry-toast__list {\n max-height: 300px;\n overflow-y: auto;\n}\n\n.debug-registry-toast__item {\n display: flex;\n align-items: flex-start;\n gap: var(--threepane-space-sm);\n padding: var(--threepane-space-sm) var(--threepane-space);\n border-left: 3px solid transparent;\n cursor: pointer;\n transition: all 0.15s ease;\n animation: toast-slide-in 0.2s ease-out;\n}\n\n.debug-registry-toast__item:hover {\n background: oklch(0.2 0.01 270);\n}\n\n.debug-registry-toast__item:not(:last-child) {\n border-bottom: 1px solid oklch(0.25 0.01 270);\n}\n\n.debug-registry-toast__icon {\n font-size: 0.875rem;\n line-height: 1;\n flex-shrink: 0;\n}\n\n.debug-registry-toast__content {\n display: flex;\n flex-direction: column;\n gap: var(--threepane-space-3xs);\n min-width: 0;\n}\n\n.debug-registry-toast__event-type {\n color: oklch(0.7 0.15 150);\n font-weight: 600;\n text-transform: uppercase;\n letter-spacing: 0.05em;\n font-size: 0.625rem;\n}\n\n.debug-registry-toast__plugin-type {\n color: oklch(0.6 0.1 60);\n font-size: 0.6875rem;\n}\n\n.debug-registry-toast__plugin-id {\n color: oklch(0.9 0.02 270);\n font-weight: 500;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n}\n@keyframes toast-slide-in {\n from {\n opacity: 0;\n transform: translateX(20px);\n }\n to {\n opacity: 1;\n transform: translateX(0);\n }\n}\n\n\n/* Isolation-mode chrome popover.\n In isolation the main document area is a sandboxed iframe, so host-realm tools\n opened from the account bar (account picker / Packages / Settings) are floated\n over the frame here instead of being routed into the iframe. The backdrop is a\n lowish-opacity, theme-tinted ink wash (dims the frame + picks up the theme's\n ink hue); the panel carries a soft drop shadow so it reads as lifted. Absolute\n inset:0 resolves to the `.frame` (its nearest positioned ancestor). */\n.frame__popover-backdrop {\n position: absolute;\n inset: 0;\n z-index: 1000;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: var(--threepane-space-2xl);\n background: color-mix(in oklch, var(--threepane-fg), transparent 82%);\n animation: frame-popover-fade var(--studio-transition, 0.15s ease);\n}\n\n.frame__popover {\n display: flex;\n flex-direction: column;\n width: min(1100px, 100%);\n height: min(900px, 100%);\n overflow: hidden;\n background: var(--threepane-bg);\n color: var(--threepane-fg);\n border: 1px solid var(--threepane-toolbar-border);\n border-radius: var(--threepane-radius-md);\n box-shadow:\n 0 32px 80px color-mix(in oklch, var(--threepane-fg), transparent 45%),\n 0 12px 32px color-mix(in oklch, var(--threepane-fg), transparent 60%),\n 0 2px 8px color-mix(in oklch, var(--threepane-fg), transparent 70%);\n animation: frame-popover-pop var(--studio-transition, 0.15s ease);\n}\n\n/* The \"Open with\" picker, docked to the popover's top. Sits at its natural\n height above the tool body; the doc-openwith tool renders a small titlebar\n button, so this is left-aligned chrome rather than a full-height view. */\n.frame__popover-toolbar {\n display: flex;\n align-items: center;\n flex: 0 0 auto;\n gap: var(--threepane-space-sm);\n padding: var(--threepane-space-sm) var(--threepane-space-md);\n border-bottom: 1px solid var(--threepane-toolbar-border);\n}\n\n.frame__popover-toolbar patchwork-view {\n display: block;\n}\n\n.frame__popover-body {\n flex: 1 1 auto;\n min-height: 0;\n overflow: auto;\n}\n\n.frame__popover-body patchwork-view {\n display: block;\n width: 100%;\n height: 100%;\n overflow: auto;\n}\n\n@keyframes frame-popover-fade {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n\n@keyframes frame-popover-pop {\n from {\n opacity: 0;\n transform: translateY(8px) scale(0.98);\n }\n to {\n opacity: 1;\n transform: none;\n }\n}\n\n/* Custom colors for event types */\n:root,\n:host,\n[theme] {\n --debug-toast-registered: var(--studio-secondary-text, color-mix(in oklch, var(--studio-secondary, #33ccf8), var(--studio-line, black) 20%));\n --debug-toast-loaded: color-mix(in oklch, var(--studio-added, #35f7ca), var(--studio-line, black) 10%);\n --debug-toast-removed: var(--studio-danger-text, color-mix(in oklch, var(--studio-danger, #ff6a90), var(--studio-line, black) 20%));\n --debug-toast-changed: var(--studio-warning-text, color-mix(in oklch, var(--studio-warning, #f8c43b), var(--studio-line, black) 10%));\n}\n\n.frame {\n.sidebar-toggle {\n position: relative;\n align-self: stretch;\n height: 100%;\n padding: 0;\n /* 1px wide, overlapping the divider border while reserving no layout column\n (content stays flush against the view's border - no offset-bg seam). The\n divider border is painted inside the following column, so a centered 2px\n strip reads half a pixel left of the line. */\n width: 1px;\n margin-inline: 0 -1px;\n margin-block: 0;\n border: 0;\n z-index: 1;\n cursor: pointer;\n /* transparent at rest - the visible divider is the main view's border; the\n handle lights up (full-height glow + pill) on hover to signal resize. */\n background: transparent;\n transition: background-color var(--studio-transition, 0.15s ease);\n /* invisible hit target straddling the divider. The toggle sits on opposite\n edges of the two sidebars (right edge of the left pane, left edge of the\n right pane), so the asymmetric grab margin is mirrored per side to stay\n centred over the divider line. */\n &::before {\n content: \"\";\n position: absolute;\n inset-block: 0;\n }\n &::after {\n content: \"\";\n position: absolute;\n top: 50%;\n left: 50%;\n width: 5px;\n height: 44px;\n border-radius: var(--threepane-radius-round);\n background: var(--threepane-resize-pill);\n opacity: 0;\n transform: translate(-50%, -50%) scaleY(0.55);\n transition: opacity var(--studio-transition, 0.15s ease),\n transform var(--studio-transition, 0.15s ease);\n pointer-events: none;\n }\n /* on hover the divider line lights up in the frame primary */\n &:hover,\n &:active {\n background: var(--threepane-resize-glow);\n }\n &:hover::after,\n &:active::after {\n opacity: 1;\n transform: translate(-50%, -50%) scaleY(1);\n }\n}\n\n.sidebar-toggle--resizable {\n cursor: col-resize;\n &:hover {\n cursor: col-resize;\n }\n &:active {\n cursor: col-resize;\n }\n}\n\n}\n\n/* Animate sidebar width on collapse/expand, but never while the handle is being\n actively dragged - the width must track the pointer 1:1 with no easing lag.\n The body flag is set for the duration of a drag by `useSidebarResize`. */\n.sidebar {\n transition: width var(--studio-transition-slow, 0.25s ease);\n}\nbody[data-sidebar-resizing] .sidebar {\n transition: none;\n}\n", "// Imported as a string (not a side-effect import) so the stylesheet is only\n// injected when the frame tool actually activates \u2014 not when index.js loads.\n// esbuild's `.css` text loader (esbuild/options.ts) returns the CSS source.\nimport frameStyles from \"./styles.css\";\n\n/**\n * Inject the threepane stylesheet into the current realm's document, once.\n *\n * Called from both realms: host-side by `PatchworkFrame`, and inside the isolated iframe by\n * `IsolationRoot`.\n */\nexport function ensureFrameStyles() {\n const id = \"patchwork-frame-styles\";\n const existing = document.getElementById(id);\n if (existing) {\n // Already injected in this realm. Refresh its contents if the bundled CSS\n // has changed (a remount after a rebuild) so a stale stylesheet from an\n // earlier mount can't shadow newer rules; otherwise leave it untouched.\n if (existing.textContent !== frameStyles) existing.textContent = frameStyles;\n return;\n }\n const el = document.createElement(\"style\");\n el.id = id;\n el.textContent = frameStyles;\n document.head.append(el);\n}\n"],
5
+ "mappings": "iDAAA,IAAAA,GAAAC,GAAA,CAAAC,GAAAC,KAAA,CAIA,IAAIC,EAAI,IACJC,EAAID,EAAI,GACRE,EAAID,EAAI,GACRE,EAAID,EAAI,GACRE,GAAID,EAAI,EACRE,GAAIF,EAAI,OAgBZJ,GAAO,QAAU,SAAUO,EAAKC,EAAS,CACvCA,EAAUA,GAAW,CAAC,EACtB,IAAIC,EAAO,OAAOF,EAClB,GAAIE,IAAS,UAAYF,EAAI,OAAS,EACpC,OAAOG,GAAMH,CAAG,EACX,GAAIE,IAAS,UAAY,SAASF,CAAG,EAC1C,OAAOC,EAAQ,KAAOG,GAAQJ,CAAG,EAAIK,GAASL,CAAG,EAEnD,MAAM,IAAI,MACR,wDACE,KAAK,UAAUA,CAAG,CACtB,CACF,EAUA,SAASG,GAAMG,EAAK,CAElB,GADAA,EAAM,OAAOA,CAAG,EACZ,EAAAA,EAAI,OAAS,KAGjB,KAAIC,EAAQ,mIAAmI,KAC7ID,CACF,EACA,GAAKC,EAGL,KAAIC,EAAI,WAAWD,EAAM,CAAC,CAAC,EACvBL,GAAQK,EAAM,CAAC,GAAK,MAAM,YAAY,EAC1C,OAAQL,EAAM,CACZ,IAAK,QACL,IAAK,OACL,IAAK,MACL,IAAK,KACL,IAAK,IACH,OAAOM,EAAIT,GACb,IAAK,QACL,IAAK,OACL,IAAK,IACH,OAAOS,EAAIV,GACb,IAAK,OACL,IAAK,MACL,IAAK,IACH,OAAOU,EAAIX,EACb,IAAK,QACL,IAAK,OACL,IAAK,MACL,IAAK,KACL,IAAK,IACH,OAAOW,EAAIZ,EACb,I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MA,EAAE,eACxB,cAAe,IAAMA,EAAE,cACvB,gBAAiB,IAAMA,EAAE,iBAAmB,GAC5C,kBAAmB,IAAMA,EAAE,mBAAqBU,EAChD,sBAAuB,IAAMV,EAAE,uBAAyB,EAC1D,CAAC,CAAC,EACKO,CACT,GAAG,EAAGT,CAAO,EACb,MAAO,IAAM,CACXK,EAAS,WAAW,EACpBE,EAAQ,CACV,CACF",
6
+ "names": ["require_ms", "__commonJSMin", "exports", "module", "s", "m", "h", "d", "w", "y", "val", "options", "type", "parse", "fmtLong", "fmtShort", "str", "match", "n", "ms", "msAbs", "plural", "name", "isPlural", "require_common", "__commonJSMin", "exports", "module", "setup", "env", "createDebug", "coerce", "disable", "enable", "enabled", "destroy", "key", "selectColor", "namespace", "hash", "i", "prevTime", "enableOverride", "namespacesCache", "enabledCache", "debug", "args", "self", "curr", "ms", "index", "match", "format", "formatter", "val", "extend", "v", "delimiter", "newDebug", "namespaces", "split", "ns", "matchesTemplate", "search", "template", "searchIndex", "templateIndex", "starIndex", "matchIndex", "name", "skip", "require_browser", "__commonJSMin", "exports", "module", "formatArgs", "save", "load", "useColors", "localstorage", "warned", "m", "args", "c", "index", "lastC", "match", "namespaces", "r", "formatters", "v", "error", "_$template", "_$createComponent", "_$setAttribute", "_$effect", "_$insert", "_$getOwner", "createMemo", "createStore", "reconcile", "render", "_$template", "_$insert", "_$getOwner", "_$use", "_$createComponent", "createUniqueId", "untrack", "isServer", "isDev", "reconcile", "makePersisted", "signal", "options", "storage", "name", "storageOptions", "serialize", "deserialize", "init", "set", "data", "value", "e", "unchanged", "get", "output", "serialized", "args", "createEffect", "createMemo", "createSignal", "on", "onCleanup", "onMount", "Show", "createEffect", "createSignal", "on", "SIDEBAR_KEYS", "COLLAPSE_CONTEXT_SIDEBAR_EVENT", "DEFAULT_SIDEBAR_WIDTH", "getStoredNumber", "key", "defaultValue", "stored", "getStoredBoolean", "useSidebarState", "isSidebarCollapsed", "setIsSidebarCollapsed", "isRightSidebarCollapsed", "setIsRightSidebarCollapsed", "leftSidebarWidth", "setLeftSidebarWidth", "rightSidebarWidth", "setRightSidebarWidth", "value", "onCleanup", "onMount", "useSidebarResize", "setLeftSidebarWidth", "setRightSidebarWidth", "setIsSidebarCollapsed", "setIsRightSidebarCollapsed", "isLeftCollapsed", "isRightCollapsed", "minWidth", "maxWidth", "autoCloseWidth", "dragThreshold", "isResizing", "dragStartPos", "hasDragged", "lastDragWidth", "setWidth", "side", "w", "setCollapsed", "value", "isCollapsed", "applyDragWidth", "raw", "settleDrag", "dragOverlay", "beginDragVisuals", "endDrag", "handleMouseDown", "e", "handleMouseUp", "dragged", "handleMouseMove", "deltaX", "deltaY", "handleToggleClick", "prev", "createEffect", "createSignal", "onCleanup", "useProviderReady", "componentId", "element", "isReady", "setReady", "el", "onMounted", "event", "createEffect", "createSignal", "onCleanup", "MOUNT_TIMEOUT_MS", "useMainDocMounted", "element", "docUrl", "isMounted", "setMounted", "el", "url", "onSettled", "event", "detail", "timer", "getRegistry", "createMemo", "createSignal", "onCleanup", "useTaggedComponents", "tag", "registry", "version", "setVersion", "off", "v", "description", "a", "b", "_$template", "_$delegateEvents", "_$setStyleProperty", "_$effect", "_$memo", "_$addEventListener", "_$insert", "createEffect", "createSignal", "onCleanup", "getAllRegistries", "_tmpl$", "_tmpl$2", "_tmpl$3", "DEBUG_MODAL_KEY", "isDebugModalEnabled", "setDebugModalEnabled", "enabled", "DEFAULT_EVENTS", "useDebugRegistryToast", "options", "subscribedEvents", "events", "setEvents", "isEnabled", "setIsEnabled", "timeouts", "addEvent", "type", "event", "pluginId", "pluginName", "newEvent", "prev", "timeoutId", "e", "dismissEvent", "eventId", "clearAll", "id", "registries", "unsubscribes", "lastPluginInfo", "registry", "trackRegistered", "plugin", "trackLoaded", "trackRemoved", "unsub", "info", "handleStorageChange", "DebugRegistryToast", "onDismiss", "onClearAll", "eventColor", "_el$", "_el$2", "_el$3", "_el$4", "_el$6", "_el$5", "_el$7", "_el$8", "_el$9", "_el$0", "_el$1", "_el$10", "_c$", "_el$11", "_$p", "_$template", "_$delegateEvents", "_$getOwner", "_$effect", "_$setAttribute", "_$memo", "_$insert", "_$createComponent", "For", "Show", "_$template", "_$delegateEvents", "_$setAttribute", "_$insert", "_$effect", "_$use", "_$createComponent", "import_debug", "log", "debug", "pojo", "target", "BLOCK_MARKER", "apply", "rest", "path", "range", "val", "p", "key", "RANGE_ARRAY", "start", "end", "ZERO_LENGTH", "DELETE", "INSERT", "APPEND", "REPLACE", "seq", "n", "a", "b", "nextkey", "get", "obj", "key", "p", "fromAutomerge", "autopatch", "payload", "path", "log", "autoproduce", "payload", "doc", "patch", "apply", "fromAutomerge", "createMemo", "onCleanup", "createStore", "produce", "reconcile", "cache", "makeDocumentProjection", "handle", "onCleanup", "item", "doc", "set", "patch", "ondelete", "payload", "autoproduce", "getOwner", "onCleanup", "createSignal", "untrack", "sharedConfig", "onMount", "DEV", "equalFn", "isServer", "access", "v", "createDocumentProjection", "handle", "createMemo", "access", "makeDocumentProjection", "createEffect", "createResource", "useContext", "createContext", "RepoContext", "useDocHandle", "url", "options", "contextRepo", "useContext", "RepoContext", "repo", "getExistingHandle", "unwrappedURL", "access", "state", "handle", "mutate", "createResource", "createEffect", "useDocument", "url", "options", "handle", "useDocHandle", "createDocumentProjection", "onCleanup", "createSignal", "createEffect", "onCleanup", "createSignal", "useContext", "getType", "getRegistry", "isLoadedPlugin", "createEffect", "createMemo", "createSignal", "onCleanup", "onMount", "Show", "_tmpl$", "_$template", "_tmpl$2", "DocumentTitle", "props", "anchor", "repo", "setRepo", "_$createComponent", "_el$", "_ref$", "_$use", "resolvedRepo", "DocumentTitleInner", "doc", "handle", "useDocument", "registry", "registryVersion", "setRegistryVersion", "off", "v", "typeId", "d", "id", "datatype", "dt", "title", "canEdit", "editing", "setEditing", "inputRef", "startEditing", "commit", "save", "next", "h", "setTitle", "meta", "_el$3", "_$insert", "_$effect", "_p$", "_v$", "_v$2", "_$setAttribute", "_el$2", "e", "_ref$2", "_$delegateEvents", "_$template", "_$delegateEvents", "_$getOwner", "_$insert", "_$createComponent", "Show", "_$template", "_$delegateEvents", "_$setStyleProperty", "_$setAttribute", "_$insert", "_$memo", "_$effect", "_$getOwner", "_tmpl$", "_tmpl$2", "_tmpl$3", "_tmpl$4", "Sidebar", "props", "widthStyle", "content", "_el$", "_p$", "_v$", "_v$2", "canExpand", "_el$2", "_c$", "_c$2", "_el$3", "e", "_c$3", "_el$4", "_c$4", "_el$5", "_c$5", "_el$6", "_c$6", "_v$3", "_v$4", "_v$5", "_$template", "_$delegateEvents", "_$setAttribute", "_$effect", "_$insert", "_$createComponent", "For", "_tmpl$", "_tmpl$2", "ContextTabs", "props", "activeToolId", "ids", "item", "selected", "_el$", "_el$2", "_tmpl$", "_$template", "_tmpl$2", "_tmpl$3", "_tmpl$4", "_tmpl$5", "ContextSidebar", "props", "items", "useTaggedComponents", "activeToolId", "ids", "item", "selected", "_$createComponent", "Sidebar", "_el$", "_$insert", "Show", "_el$2", "_el$3", "ContextTabs", "PanelRightIcon", "_el$4", "id", "_el$5", "_$getOwner", "_$delegateEvents", "_$template", "_$effect", "_$getOwner", "_$createComponent", "_$memo", "Show", "_tmpl$", "slotId", "slot", "uniqueSlots", "slots", "seen", "id", "SlotView", "props", "_el$", "tuple", "_el$2", "_p$", "_v$", "_v$2", "_tmpl$", "_$template", "_tmpl$2", "_tmpl$3", "_tmpl$4", "_tmpl$5", "FrameTopBar", "props", "docToolSlots", "_el$", "_el$3", "_$insert", "_$createComponent", "Show", "_el$2", "DocumentTitle", "_$memo", "_el$4", "For", "slot", "_el$6", "_$getOwner", "_$effect", "_p$", "_v$", "slotId", "_v$2", "_el$5", "_$setAttribute", "PanelRightIcon", "_$delegateEvents", "_$template", "_$effect", "_$getOwner", "_$insert", "_$memo", "_$createComponent", "_$use", "Show", "_tmpl$", "_tmpl$2", "_tmpl$3", "MainDocumentView", "viewKey", "selectedDocUrl", "toolId", "ref", "_el$", "_ref$", "key", "_el$2", "_p$", "_v$", "_v$2", "_c$", "_tmpl$", "_$template", "_tmpl$2", "_tmpl$3", "MIN_SIDEBAR_WIDTH", "MAX_SIDEBAR_WIDTH", "AUTO_CLOSE_WIDTH", "DRAG_THRESHOLD", "DocumentAreaRoot", "props", "isRightSidebarCollapsed", "setIsRightSidebarCollapsed", "createSignal", "rightSidebarWidth", "setRightSidebarWidth", "createEffect", "on", "value", "SIDEBAR_KEYS", "setUnusedLeftWidth", "setUnusedLeftCollapsed", "sidebarResize", "useSidebarResize", "onMount", "onCollapse", "COLLAPSE_CONTEXT_SIDEBAR_EVENT", "onCleanup", "selectedContextToolId", "setSelectedContextToolId", "makePersisted", "draftStateProviderHost", "setDraftStateProviderHost", "isDraftStateProviderReady", "useProviderReady", "readyDraftStateHost", "_$createComponent", "Show", "docUrl", "_el$", "_$use", "_$getOwner", "_$insert", "host", "DraftDocumentArea", "contextItems", "useTaggedComponents", "hasContext", "mainViewKey", "createMemo", "draftOverlayProviderHost", "setDraftOverlayProviderHost", "isDraftOverlayProviderReady", "commentsProviderElement", "setCommentsProviderElement", "isCommentsProviderReady", "focusProviderElement", "setFocusProviderElement", "isFocusProviderReady", "areDocProvidersReady", "_el$2", "_el$3", "_el$4", "_el$5", "_el$6", "_el$7", "FrameTopBar", "v", "MainDocumentView", "el", "ContextSidebar", "styles_default", "ensureFrameStyles", "id", "existing", "styles_default", "el", "_tmpl$", "_$template", "_tmpl$2", "IsolatedDocumentArea", "props", "rootUrls", "createMemo", "urls", "selected", "propsJson", "_el$", "_el$2", "_$getOwner", "_$insert", "_$effect", "_$setAttribute", "parseProps", "script", "err", "mountIsolationRoot", "element", "ensureFrameStyles", "p", "setP", "createStore", "observer", "reconcile", "dispose", "render", "_el$3", "_$createComponent", "DocumentAreaRoot", "DEFAULT_SIDEBAR_WIDTH"]
7
7
  }